Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
UpdateTargetAbilityEvent: Unit tests
  • Loading branch information
gravelweb committed Jun 11, 2016
commit 9fd95acbc447ee2adc492ae983cb7a4ca1156c1e
Binary file added test_replays/3.3.0/ggissue48.SC2Replay
Binary file not shown.
Binary file added test_replays/3.3.0/ggissue49.SC2Replay
Binary file not shown.
20 changes: 16 additions & 4 deletions test_replays/test_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,12 +495,24 @@ def test_33(self):
replay = sc2reader.load_replay("test_replays/3.3.0/{}.SC2Replay".format(replaynum))
self.assertTrue(replay is not None)

def test_33_shift_click_calldown_mule(self):
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue48.SC2Replay")
def efilter(e):
return hasattr(e, "ability") and e.ability_name == "CalldownMULE"
self.assertEqual(len(filter(efilter, replay.events)), 29)

def test_33_shift_click_spawn_larva(self):
replay = sc2reader.load_replay("test_replays/3.3.0/ggissue49.SC2Replay")
def efilter(e):
return hasattr(e, "ability") and e.ability_name == "SpawnLarva"
self.assertEqual(len(filter(efilter, replay.events)), 23)

def test_lotv_time(self):
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
self.assertEqual(replay.length.seconds, 1002)
self.assertEqual(replay.real_length.seconds, 1002)
replay = sc2reader.load_replay("test_replays/lotv/lotv1.SC2Replay")
self.assertEqual(replay.length.seconds, 1002)
self.assertEqual(replay.real_length.seconds, 1002)



class TestGameEngine(unittest.TestCase):
class TestEvent(object):
name='TestEvent'
Expand Down