In load&save test, force to have a merchant

This commit is contained in:
Yohann D'ANELLO 2020-12-09 15:09:07 +01:00
parent 39787861dc
commit cea015d015
1 changed files with 8 additions and 1 deletions

View File

@ -7,7 +7,7 @@ import unittest
from ..bootstrap import Bootstrap
from ..display.display import Display
from ..display.display_manager import DisplayManager
from ..entities.friendly import Sunflower
from ..entities.friendly import Sunflower, Merchant
from ..entities.items import Bomb
from ..entities.player import Player
from ..enums import DisplayActions
@ -35,7 +35,14 @@ class TestGame(unittest.TestCase):
"""
bomb = Bomb()
self.game.map.add_entity(bomb)
# Add an item in the inventory to check that it is well loaded
bomb.hold(self.game.player)
# Ensure that merchants can be saved
merchant = Merchant()
merchant.move(3, 6)
self.game.map.add_entity(merchant)
old_state = self.game.save_state()
self.game.handle_key_pressed(KeyValues.DOWN)