Add trade
This commit is contained in:
@@ -307,3 +307,37 @@ class TestWorld(unittest.TestCase):
|
||||
|
||||
game.play_until(training + 60)
|
||||
self.assertResourcesMatch([500 + gathered, 425, 500, 500], game.world)
|
||||
|
||||
|
||||
def test_trade_cog(self):
|
||||
game = Gameplay()
|
||||
|
||||
# just cheat
|
||||
game.world.age = Ages.FEUDAL
|
||||
game.world.gather.resources = [500, 500, 500, 500]
|
||||
game.world._add_building(Buildings.DOCK, {}, {})
|
||||
|
||||
game.queue_trade_cog(0)
|
||||
|
||||
training = 36
|
||||
gathered = 25.9
|
||||
|
||||
game.play_until(training + 60)
|
||||
self.assertResourcesMatch([500, 400, 450 + gathered, 500], game.world)
|
||||
|
||||
|
||||
def test_trade_cart(self):
|
||||
game = Gameplay()
|
||||
|
||||
# just cheat
|
||||
game.world.age = Ages.FEUDAL
|
||||
game.world.gather.resources = [500, 500, 500, 500]
|
||||
game.world._add_building(Buildings.MARKET, {}, {})
|
||||
|
||||
game.queue_trade_cart(0)
|
||||
|
||||
training = 51
|
||||
gathered = 25.9
|
||||
|
||||
game.play_until(training + 60)
|
||||
self.assertResourcesMatch([500, 400, 450 + gathered, 500], game.world)
|
||||
|
||||
Reference in New Issue
Block a user