def test_invade_3(self): env = Environment("map_init.txt", "population_init.txt") try: env.invade(GamePlayId.P2, 1, 4, 1) except Exception as error: self.assertEqual( str(error), "Can't invade no route from ( " + str(1) + " ) to ( " + str(4) + " )")
def test_invade_2(self): env = Environment("map_init.txt", "population_init.txt") try: env.invade(GamePlayId.P2, 2, 4, 1) except Exception as error: self.assertEqual(str(error), "Can't invade your own country")
def test_invade_1(self): env = Environment("map_init.txt", "population_init.txt") env.invade(GamePlayId.P2, 2, 3, 6) self.assertEqual(env.country_list[1].troops_count, 1) self.assertEqual(env.country_list[2].troops_count, 1) self.assertEqual(env.country_list[1].owner_id, GamePlayId.P2)