Skip to content

Commit 9fd95ac

Browse files
committed
UpdateTargetAbilityEvent: Unit tests
1 parent 9520a57 commit 9fd95ac

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed
61.2 KB
Binary file not shown.
50.2 KB
Binary file not shown.

test_replays/test_all.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -495,12 +495,24 @@ def test_33(self):
495495
replay = sc2reader.load_replay("test_replays/3.3.0/{}.SC2Replay".format(replaynum))
496496
self.assertTrue(replay is not None)
497497

498+
def test_33_shift_click_calldown_mule(self):
499+
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue48.SC2Replay")
500+
def efilter(e):
501+
return hasattr(e, "ability") and e.ability_name == "CalldownMULE"
502+
self.assertEqual(len(filter(efilter, replay.events)), 29)
503+
504+
def test_33_shift_click_spawn_larva(self):
505+
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue49.SC2Replay")
506+
def efilter(e):
507+
return hasattr(e, "ability") and e.ability_name == "SpawnLarva"
508+
self.assertEqual(len(filter(efilter, replay.events)), 23)
509+
498510
def test_lotv_time(self):
499-
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
500-
self.assertEqual(replay.length.seconds, 1002)
501-
self.assertEqual(replay.real_length.seconds, 1002)
511+
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
512+
self.assertEqual(replay.length.seconds, 1002)
513+
self.assertEqual(replay.real_length.seconds, 1002)
514+
502515

503-
504516
class TestGameEngine(unittest.TestCase):
505517
class TestEvent(object):
506518
name='TestEvent'

0 commit comments

Comments
 (0)