Beispiel #1
0
 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()))
Beispiel #2
0
 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)
Beispiel #3
0
 def testTwoUnitVisualContact(self):
   # load the scenario
   import sandbox_world
   world = sandbox_world.sandbox('testTwoFireTeamsUTM.xml')
   
   # Run for an hour
   world.Simulate()
   
   self.assertTrue(True)
Beispiel #4
0
    def testTwoUnitVisualContact(self):
        # load the scenario
        import sandbox_world
        world = sandbox_world.sandbox('testTwoFireTeamsUTM.xml')

        # Run for an hour
        world.Simulate()

        self.assertTrue(True)
Beispiel #5
0
 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')
Beispiel #6
0
    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")
Beispiel #7
0
 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))
Beispiel #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])
Beispiel #9
0
 def testLoadOneFireTeamUTM(self):
   sbox = sandbox_world.sandbox('testOneFireTeamUTM.xml')
   self.assertTrue(sbox.OS['gametag'],'One Fire Team with Named Location')
Beispiel #10
0
 def testLoadBasicWorld(self):
   sbox = sandbox_world.sandbox('blankworld.xml')
   self.assertTrue(sbox.OS['gametag'],'Blank World')
Beispiel #11
0
 def testLoadBasicWorldDefault(self):
   sbox = sandbox_world.sandbox()
   self.assertTrue(sbox.OS['gametag'],'Blank World')
Beispiel #12
0
 def setUp(self):
     self.W = sandbox_world.sandbox()
     # Create a single unit.
     self.W.AddEntity(sandbox_entity.sandbox_entity(template="FireTeam", sim=self.W))
Beispiel #13
0
 def setUp(self):
     self.W = sandbox_world.sandbox()
     # Create a single unit.
     self.W.AddEntity(
         sandbox_entity.sandbox_entity(template='FireTeam', sim=self.W))