Skip to content

Commit ecd1c5b

Browse files
committed
added a test for 2v2 type
1 parent 4b495ef commit ecd1c5b

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed
21 KB
Binary file not shown.
40.3 KB
Binary file not shown.

test_replays/test_all.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,12 @@ def test_private_category():
9191

9292
assert replay.is_private == True
9393
assert replay.is_ladder == False
94-
94+
95+
def test_2v2():
96+
# Source: http://drop.sc/82
97+
replay = Replay("test_replays/build17811/3.sc2replay")
98+
assert replay.type == "2v2"
99+
95100
def test_3v3():
96101
replay = Replay("test_replays/build17811/3.sc2replay")
97102

@@ -109,6 +114,14 @@ def test_random_player():
109114
assert gogeta.choosen_race == "Random"
110115
assert gogeta.actual_race == "Terran"
111116

117+
# Ha! This was actually failing with phpsc2replay! (Didn't produce the right Random race)
118+
# Hooray, major milestone as phpsc2replay isn't a superset of sc2readera anymore!
119+
def test_random_player2():
120+
replay = Replay("test_replays/build17811/6.sc2replay")
121+
permafrost = replay.player["Permafrost"]
122+
assert permafrost.choosen_race == "Random"
123+
assert permafrost.actual_race == "Protoss"
124+
112125
def test_us_realm():
113126
replay = Replay("test_replays/build17811/5.sc2replay")
114127

0 commit comments

Comments
 (0)