Skip to content

Commit 763a88c

Browse files
committed
Test for LotV apm fix.
1 parent 604e629 commit 763a88c

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test_replays/test_all.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,18 @@ def test_lotv_time(self):
494494
self.assertEqual(replay.length.seconds, 1002)
495495
self.assertEqual(replay.real_length.seconds, 1002)
496496

497+
def test_lotv_apm(self):
498+
from sc2reader.factories.plugins.replay import APMTracker, SelectionTracker, toJSON
499+
factory = sc2reader.factories.SC2Factory()
500+
factory.register_plugin("Replay", APMTracker())
501+
replay = factory.load_replay("test_replays/lotv/lotv1.SC2Replay")
502+
for player in replay.players:
503+
from pprint import pprint
504+
pprint(player)
505+
if player.name == 'Zenchii':
506+
print("Zenchii apm:",player.avg_apm)
507+
self.assertTrue(int(player.avg_apm) == 56)
508+
497509

498510
class TestGameEngine(unittest.TestCase):
499511
class TestEvent(object):

0 commit comments

Comments
 (0)