Skip to content

v2.4.2 - Test Suite Fixes

Choose a tag to compare

@Nostoi Nostoi released this 28 Dec 04:40
· 1631 commits to master since this release

Release 2.4.2: Complete Test Suite Fixes

All test suites now passing at 100%!

Test Results

  • ✅ Integration tests: 43/43 passing (100%)
  • ✅ Command tests: 292/292 working (100%)
  • ✅ Mobprog scenario tests: 7/7 passing (100%)

Fixes

Mobprog Integration Tests

  1. test_quest_completion_workflow: Fixed run_prog() call to use arg1 parameter instead of obj
  2. test_mob_casts_spell_at_low_health:
    • Corrected HP threshold (29 vs 30) to account for < comparison in HPCNT trigger
    • Fixed mock to intercept mob_cmds.mob_interpret() instead of dispatcher.process_command()
  3. test_guard_chain_reaction:
    • Added RNG mock to ensure greet trigger fires consistently
    • Fixed phrase matching by lowercasing (case-sensitive comparison)

Command Test Fixtures

  • Added missing room methods: add_character(), remove_character()
  • Added missing room attributes: contents, board_name
  • Added all 6 exit directions with proper target rooms
  • Added missing PCData attributes: last_notes, board_name

Technical Details

Mobprog API Corrections:

  • run_prog() signature uses arg1 for objects, not obj (see mud/mobprog.py:1248-1256)
  • Mob commands route through mob_cmds.mob_interpret(), not dispatcher.process_command() (see mud/mobprog.py:1122)

HPCNT Trigger Logic:

  • Trigger fires when percent < threshold, so 30% HP doesn't trigger with threshold "30" (see mud/mobprog.py:1504)

Speech Trigger Matching:

  • Phrase matching is case-sensitive: "halt" in "Halt!" returns False (see mud/mobprog.py:1238)

Verification

pytest tests/integration/ -v      # 43 passed
python3 test_all_commands.py      # 292/292 working
pytest tests/test_mobprog.py -v   # 45 passed

Files Changed

  • tests/integration/test_mobprog_scenarios.py
  • test_all_commands.py
  • pyproject.toml (version bump)
  • README.md (version badge)

Full Changelog: v2.4.1...v2.4.2