Skip to content

Commit 315e8a9

Browse files
committed
fix and tests for the new s2gs fields
1 parent 1d359ef commit 315e8a9

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

sc2reader/resources.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,10 @@ def load_players(self):
10391039
# HotS Stats
10401040
player.upgrade_spending_graph = stats.get('Upgrade Spending', None)
10411041
player.workers_active_graph = stats.get('Workers Active', None)
1042-
player.enemies_destroyed = stats.get('Enemies Destroyed',None)
1042+
player.enemies_destroyed = stats.get('Enemies Destroyed:',None)
10431043
player.time_supply_capped = stats.get('Time Supply Capped', None)
10441044
player.idle_production_time = stats.get('Idle Production Time', None)
1045-
player.resources_spent = stats.get('Resources Spent', None)
1045+
player.resources_spent = stats.get('Resources Spent:', None)
10461046
player.apm = stats.get('APM', None)
10471047

10481048
# Economic Breakdown Tab

test_s2gs/hots2.s2gs

13.7 KB
Binary file not shown.

test_s2gs/test_all_s2gs.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,13 @@ def test_a_HotS_s2gs():
1919
summary = sc2reader.load_game_summary("test_s2gs/hots1.s2gs")
2020
assert summary.players[0].resource_collection_rate == 1599
2121
assert summary.players[0].build_order[0].order == 'SCV'
22+
23+
def test_another_HotS_s2gs():
24+
summary = sc2reader.load_game_summary("test_s2gs/hots2.s2gs")
25+
assert summary.players[0].enemies_destroyed == 14575
26+
assert summary.players[0].time_supply_capped == 50
27+
assert summary.players[0].idle_production_time == 4438
28+
assert summary.players[0].resources_spent == 25450
29+
assert summary.players[0].apm == 204
30+
assert summary.players[0].workers_active_graph.as_points()[8][1] == 25
31+
assert summary.players[0].upgrade_spending_graph.as_points()[8][1] == 300

0 commit comments

Comments
 (0)