def testLoadSavedGameWithUnit(self): # Create a blank world sbox = sandbox_world.sandbox('testOneFireTeamUTM.xml') # Run it once for 1 hour then save sbox.Simulate() sbox.Save() ooblen = len(sbox.GetOOB()) # Load most recent save for this game sbox = sandbox_world.sandbox('One Fire Team UTM') self.assertEqual(ooblen, len(sbox.GetOOB()))
def testLoadSavedGame(self): # Create a blank world sbox = sandbox_world.sandbox('blankworld.xml') # Run it once for 1 hour then save sbox.Simulate() sbox.Save() clock1 = sbox.GetClock() # Load most recent save for this game sbox = sandbox_world.sandbox('Blank World') # Get Clock clock2 = sbox.GetClock() self.assertEqual(clock1, clock2)
def testTwoUnitVisualContact(self): # load the scenario import sandbox_world world = sandbox_world.sandbox('testTwoFireTeamsUTM.xml') # Run for an hour world.Simulate() self.assertTrue(True)
def setUp(self): from sandbox_world import sandbox if __name__ == '__main__': os.chdir('..') # An empty simulator self.sim = sandbox() # test folder name if os.getcwd().endswith('lib'): self.testfolder = os.path.join('..','tests') else: self.testfolder = os.path.join('tests')
def setUp(self): from sandbox_world import sandbox if __name__ == "__main__": os.chdir("..") # An empty simulator self.sim = sandbox() # test folder name if os.getcwd().endswith("lib"): self.testfolder = os.path.join("..", "tests") else: self.testfolder = os.path.join("tests")
def testExecuteBlankFromXML(self): sbox = sandbox_world.sandbox('blankworldexec.xml') # Retrieve the clock clock = sbox.GetClock() # It should be 0800 after execution self.assertEqual(clock, datetime.datetime(2010,1,3,8,0))
def testCreateFileSystem(self): sbox = sandbox_world.sandbox('testOneFireTeamUTM.xml') # Check for file system override rootexists = os.path.exists(os.path.join('Simulations','One_Fire_Team_UTM')) blue = os.path.exists(os.path.join('Simulations','One_Fire_Team_UTM','BLUE')) self.assertEqual([rootexists,blue],[True,True])
def testLoadOneFireTeamUTM(self): sbox = sandbox_world.sandbox('testOneFireTeamUTM.xml') self.assertTrue(sbox.OS['gametag'],'One Fire Team with Named Location')
def testLoadBasicWorld(self): sbox = sandbox_world.sandbox('blankworld.xml') self.assertTrue(sbox.OS['gametag'],'Blank World')
def testLoadBasicWorldDefault(self): sbox = sandbox_world.sandbox() self.assertTrue(sbox.OS['gametag'],'Blank World')
def setUp(self): self.W = sandbox_world.sandbox() # Create a single unit. self.W.AddEntity(sandbox_entity.sandbox_entity(template="FireTeam", sim=self.W))
def setUp(self): self.W = sandbox_world.sandbox() # Create a single unit. self.W.AddEntity( sandbox_entity.sandbox_entity(template='FireTeam', sim=self.W))