Created the file test_handle_short_events.py to test the functions of the HandleShortEvents class. I made an empty TestCase for each of the functions, as a base to be filled in later.
Created 1 test for reset() function. A little long, but tests all attributes changing.
Created 7 tests for handle_accessories() function, 100% coverage.
Made some modifications to handle_short_events.py, to:
Use getatt() to check some attributes exist.
Simplify "tail_accessories in acc_list" check to remove print exceptions
Note: I mocked the event, but left in the Cat and Pelt imports for now. The other functions all use the imported game. I did get a handle_herb_supply() test working with the game imported, but it's not finished. Ideally tests would only test the class, without needing imports, but this could take a while.
Why This Is Good For ClanGen
Increasing test coverage helps with finding potential bugs in the codebase.
About The Pull Request
Created the file test_handle_short_events.py to test the functions of the HandleShortEvents class. I made an empty TestCase for each of the functions, as a base to be filled in later.
Created 1 test for reset() function. A little long, but tests all attributes changing.
Created 7 tests for handle_accessories() function, 100% coverage.
Made some modifications to handle_short_events.py, to:
Note: I mocked the event, but left in the Cat and Pelt imports for now. The other functions all use the imported game. I did get a handle_herb_supply() test working with the game imported, but it's not finished. Ideally tests would only test the class, without needing imports, but this could take a while.
Why This Is Good For ClanGen
Proof of Testing
Changelog/Credits