@@ -88,34 +88,39 @@ def test_standard_1v1():
8888
8989def test_private_category ():
9090 replay = Replay ("test_replays/build17811/2.sc2replay" )
91-
9291 assert replay .is_private == True
9392 assert replay .is_ladder == False
9493
9594def test_2v2 ():
96- # Source: http://drop.sc/82
9795 replay = Replay ("test_replays/build17811/7.sc2replay" )
9896 assert replay .type == "2v2"
9997
10098def test_3v3 ():
10199 replay = Replay ("test_replays/build17811/3.sc2replay" )
102-
103100 assert replay .type == "3v3"
104101
105102 # Because it's a 3v3 and all of the members of Team 2 quit, we should know the winner.
106103 assert replay .results [1 ] == "Won"
107104 assert replay .results [2 ] == "Lost"
108105
109106def test_4v4 ():
110- # Source: http://drop.sc/32
111107 replay = Replay ("test_replays/build17811/9.sc2replay" )
112108 assert replay .type == "4v4"
113109
114110def test_ffa ():
115- # Source: http://drop.sc/83
116111 replay = Replay ("test_replays/build17811/8.sc2replay" )
117112 assert replay .type == "FFA"
118- assert replay .player ['Boom' ].result == "Won"
113+
114+ # Player 'Boom' won because the last building of the last player was destroyed,
115+ # but the winner cannot be parsed because "Player has left" event isn't generated.
116+ # Unknown result is the best we can do.
117+ assert replay .winner_known == False
118+
119+ def test_unknown_winner ():
120+ replay = Replay ("test_replays/build17811/10.sc2replay" )
121+
122+ # Recording player (Boom) left second, so the winner shouldn't be known
123+ assert replay .winner_known == False
119124
120125def test_random_player ():
121126 replay = Replay ("test_replays/build17811/3.sc2replay" )
@@ -132,7 +137,6 @@ def test_random_player2():
132137
133138def test_us_realm ():
134139 replay = Replay ("test_replays/build17811/5.sc2replay" )
135-
136140 assert replay .player ['ShadesofGray' ].url == "http://us.battle.net/sc2/en/profile/2358439/1/ShadesofGray/"
137141 assert replay .player ['reddawn' ].url == "http://us.battle.net/sc2/en/profile/2198663/1/reddawn/"
138142
0 commit comments