def test_occupied_by(self): london = CoastalTerritory(self.state, 1, 'London', 'England', [], []) wales = CoastalTerritory(self.state, 2, 'Wales', 'England', [], []) paris = InlandTerritory(self.state, 3, 'Paris', 'England', []) Army(self.state, 0, 'England', london) Army(self.state, 0, 'France', paris) self.assertTrue(london.occupied_by('England')) self.assertFalse(wales.occupied_by('England')) self.assertFalse(paris.occupied_by('England'))
def test_occupied_by(self): london = CoastalTerritory(1, 'London', 'England', [], []) wales = CoastalTerritory(2, 'Wales', 'England', [], []) paris = InlandTerritory(3, 'Paris', 'England', []) self.state.register(london, wales, paris) army_london = Army('England', london) army_paris = Army('France', paris) self.state.register(army_london, army_paris) self.assertTrue(london.occupied_by('England')) self.assertFalse(wales.occupied_by('England')) self.assertFalse(paris.occupied_by('England'))