File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change 3
3
4
4
import datetime
5
5
import json
6
+ from xml .dom import minidom
6
7
7
8
# Newer unittest features aren't built in for python 2.6
8
9
import sys
@@ -466,6 +467,16 @@ def test_38996(self):
466
467
self .assertEqual (replay .expansion , 'LotV' )
467
468
replay = sc2reader .load_replay ("test_replays/3.0.0.38996/2.SC2Replay" )
468
469
self .assertEqual (replay .expansion , 'LotV' )
470
+
471
+ def test_funny_minerals (self ):
472
+ replay = sc2reader .load_replay ("test_replays/3.1.0/centralprotocol.SC2Replay" )
473
+ replay .load_map ()
474
+ xmldoc = minidom .parseString (replay .map .archive .read_file ('Objects' ))
475
+ itemlist = xmldoc .getElementsByTagName ('ObjectUnit' )
476
+ mineralPosStrs = [ou .attributes ['Position' ].value for ou in itemlist if 'MineralField' in ou .attributes ['UnitType' ].value ]
477
+ mineralFieldNames = list (set ([ou .attributes ['UnitType' ].value for ou in itemlist if 'MineralField' in ou .attributes ['UnitType' ].value ]))
478
+ #print mineralFieldNames
479
+ self .assertTrue (len (mineralPosStrs ) > 0 )
469
480
470
481
471
482
class TestGameEngine (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments