예제 #1
0
def test_diplo1(s, p):

    (p0, s0), (p1, s1) = setup_combat(s, UNITS.FRIGATE)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    # declare peace
    AddAllyPair(p0, p1).execute(s)

    s.run(seconds=60)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    # declare peace
    AddNeutralPair(p0, p1).execute(s)

    s.run(seconds=60)

    assert health(s0) == max_health(s0)
    assert health(s1) == max_health(s1)

    # declare war
    AddEnemyPair(p0, p1).execute(s)
    s.run(seconds=60)

    assert health(s0) != max_health(s0)
    assert health(s1) != max_health(s1)
예제 #2
0
	def add_ally(self):
		"""
		Callback for setting ally status between local player and tab's player
		"""
		AddAllyPair(self.player, self.local_player).execute(self.player.session)
		# check the correct checkbox
		self.check_diplomacy_state()