def test_place_armies(self): map, situation = test_datastructure.setup_test_map() logic = Game(self.__default_game_state(map, situation), 5) situation.update_map(MapUpdate('holland', 'me', 16)) situation.update_map(MapUpdate('germany', 'them', 10)) situation.update_map(MapUpdate('uk', None, 2)) placeds = logic.place_armies() self.assertIn(Deployment('me', 'holland', 5), placeds)
def test_pick_starting_armies(self): map, situation = test_datastructure.setup_test_map() game = Game(self.__default_game_state(map, situation)) game.init_samplers() picked_regions = game.pick_starting_regions([ 'sahara', 'egypt', 'new zealand', 'australia (doh)', 'chile', 'argentina', 'peru', 'brazil', 'iceland', 'uk', 'holland', 'germany'])
def test_move(self): map, situation = test_datastructure.setup_test_map() game = Game(self.__default_game_state(map, situation), 5) situation.update_map(MapUpdate('holland', 'me', 21)) situation.update_map(MapUpdate('germany', 'them', 10)) situation.update_map(MapUpdate('uk', 'them', 2)) moves = game.make_moves() self.assertIn(Move('me', 'holland', 'uk', 5), moves) situation.update_map(MapUpdate('holland', 'me', 21)) situation.update_map(MapUpdate('germany', 'them', 10)) situation.update_map(MapUpdate('uk', None, 2)) moves = game.make_moves() self.assertIn(Move('me', 'holland', 'germany', 20), moves) situation.update_map(MapUpdate('holland', 'me', 200)) situation.update_map(MapUpdate('germany', 'them', 10)) situation.update_map(MapUpdate('uk', None, 2)) moves = game.make_moves() self.assertIn(Move('me', 'holland', 'germany', 25), moves)