예제 #1
0
 def test_update_given_intel_maps_vespene_geysers_properly(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertNotEqual(None, man.vespene_geysers[4306239489])
예제 #2
0
 def test_update_given_intel_maps_spawning_pool_unit_properly(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertNotEqual(None, man.unit_data[89])
예제 #3
0
 def test_update_given_intel_maps_ling_speed_upgrade_properly(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertNotEqual(None, man.upgrade_data[66])
예제 #4
0
 def test_update_given_intel_maps_psi_storm_buff_properly(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertNotEqual(None, man.buff_data[28])
예제 #5
0
 def test_update_given_intel_maps_destructible_rock_properly(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertNotEqual(None, man.destructibles[8776253521])
예제 #6
0
 def test_is_vespene_geyser_given_vespene_geyser_returns_true(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_vespene_geyser(342)
     # Assert
     self.assertTrue(r)
예제 #7
0
 def test_is_mineralfield_given_mineralfield_returns_true(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_mineralfield(483)
     # Assert
     self.assertTrue(r)
예제 #8
0
 def test_is_worker_given_marine_returns_false(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_worker(48)
     # Assert
     self.assertFalse(r)
예제 #9
0
 def test_is_worker_given_probe_returns_true(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_worker(84)
     # Assert
     self.assertTrue(r)
예제 #10
0
 def test_is_destructible_given_mineralfield_returns_false(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_destructible(483)
     # Assert
     self.assertFalse(r)
예제 #11
0
 def test_is_building_given_spawning_pool_returns_true(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_building(89)
     # Assert
     self.assertTrue(r)
예제 #12
0
 def test_is_destructible_given_destructible_rock_returns_true(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_destructible(371)
     # Assert
     self.assertTrue(r)
예제 #13
0
 def test_isBuilding_given_probe_returns_false(self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     r = man.is_building(84)
     # Assert
     self.assertFalse(r)
예제 #14
0
 def test_tech_requirements_given_spawning_pool_and_already_build_hatchery_returns_empty_list(
         self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     res = man.tech_requirements(89)
     # Assert
     self.assertEqual([], res)
예제 #15
0
 def test_tech_requirements_full_given_spawning_pool_returns_list_with_hatchery(
         self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     man.update_intel(intel)
     # Act
     res = man.tech_requirements_full(89)
     # Assert
     self.assertTrue(man.get_unit_type_data(86) in res)
예제 #16
0
 def test_update_given_intel_response_adds_repeated_data_with_multiple_elements_to_intel_manager(
         self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertEqual(len(intel.alliedWorkers), len(man.allied_workers))
     self.assertEqual(len(intel.alliedUnits), len(man.allied_units))
     self.assertEqual(len(intel.enemyVisibleWorkers),
                      len(man.enemy_visible_workers))
     self.assertEqual(len(intel.alliedBuildings), len(man.allied_buildings))
예제 #17
0
 def test_update_given_intel_response_adds_repeated_data_with_one_element_to_intel_manager(
         self):
     # Arrange
     intel = create_intel_response()
     man = IntelManager.IntelManager()
     # Act
     man.update_intel(intel)
     # Assert
     self.assertEqual(len(intel.enemyVisibleBuildings),
                      len(man.enemy_visible_buildings))
     self.assertEqual(len(intel.enemyVisibleUnits),
                      len(man.enemy_visible_units))
     self.assertEqual(len(intel.enemyVisibleUnits),
                      len(man.enemy_visible_units))