summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-22 02:17:02 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-22 02:17:02 -0500
commit80cda61ec4478db3253741bc32beae0f6edd5b78 (patch)
tree4fe26ea5e963d7b91f6d4afa54e317065627ba75 /tests
parent912efe7fd0127a0abd5c92c51990d732b18d32a6 (diff)
test autoplayer handle_mom
Diffstat (limited to 'tests')
-rw-r--r--tests/test_vba.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/test_vba.py b/tests/test_vba.py
index 1b151b7..ec74a55 100644
--- a/tests/test_vba.py
+++ b/tests/test_vba.py
@@ -123,5 +123,24 @@ class VbaTests(unittest.TestCase):
self.assertTrue("TRAINER" in text)
+ def test_speedrunner_constructor(self):
+ runner = autoplayer.SpeedRunner(cry=self.cry)
+
+ def test_speedrunner_handle_mom(self):
+ self.vba.shutdown()
+
+ # TODO: why can't i pass in the current state of the emulator?
+ runner = autoplayer.SpeedRunner(cry=None)
+ runner.setup()
+ runner.skip_intro(skip=True)
+ runner.handle_mom(skip=False)
+
+ # confirm that handle_mom is done by attempting to move on the map
+ first_map_y = self.get_wram_value("MapY")
+ runner.cry.move("d")
+ second_map_y = self.get_wram_value("MapY")
+
+ self.assertNotEqual(first_map_y, second_map_y)
+
if __name__ == "__main__":
unittest.main()