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 33
44import datetime
55import json
6+ from xml .dom import minidom
67
78# Newer unittest features aren't built in for python 2.6
89import sys
@@ -466,6 +467,16 @@ def test_38996(self):
466467 self .assertEqual (replay .expansion , 'LotV' )
467468 replay = sc2reader .load_replay ("test_replays/3.0.0.38996/2.SC2Replay" )
468469 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 )
469480
470481
471482class TestGameEngine (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments