summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBryan Bishop <kanzure@gmail.com>2013-09-22 02:48:41 -0500
committerBryan Bishop <kanzure@gmail.com>2013-09-22 02:48:41 -0500
commit742bdf8c2fffccf1c216f08192693dab7241a597 (patch)
tree7d9746082e1a2492b1b78f4418f8a06053f5c6e8 /tests
parent50997c8b3849d70483266dce2661e3f076558cc6 (diff)
test that the Elm's Lab sequence works
Diffstat (limited to 'tests')
-rw-r--r--tests/test_vba.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_vba.py b/tests/test_vba.py
index 9f7b8f1..55489fb 100644
--- a/tests/test_vba.py
+++ b/tests/test_vba.py
@@ -169,5 +169,29 @@ class VbaTests(unittest.TestCase):
self.assertEqual(self.get_wram_value("MapGroup"), 24)
self.assertEqual(self.get_wram_value("MapNumber"), 4)
+ def test_speedrunner_handle_elm(self):
+ self.vba.shutdown()
+
+ runner = autoplayer.SpeedRunner(cry=None)
+ runner.setup()
+ runner.skip_intro(skip=True)
+ runner.handle_mom(skip=True)
+ runner.walk_into_new_bark_town(skip=False)
+
+ # go through the Elm's Lab sequence
+ runner.handle_elm("cyndaquil", skip=False)
+
+ # test again if the game is in a state where the player can walk
+ first_map_y = self.get_wram_value("MapY")
+ runner.cry.move("d")
+ second_map_y = self.get_wram_value("MapY")
+
+ # check that the player has moved
+ self.assertNotEqual(first_map_y, second_map_y)
+
+ # check that the map is correct
+ self.assertEqual(self.get_wram_value("MapGroup"), 24)
+ self.assertEqual(self.get_wram_value("MapNumber"), 5)
+
if __name__ == "__main__":
unittest.main()