def test_interact_no_interaction(self): house = random_building(is_interactive=False) actor = random_character_entity() actor_gold_before = actor.gold actor_items_before = actor.items.copy() entries = house.interact(actor) print(entries) self.assertEqual(actor_gold_before, actor.gold) self.assertEqual(actor_items_before, actor.items)
def test_interact_talks_only(self): house = random_building(min_talks=1, gold=False, item=False) actor = random_character_entity() actor_gold_before = actor.gold actor_items_before = actor.items.copy() entries = house.interact(actor) print(entries) self.assertEqual(actor_gold_before, actor.gold) self.assertEqual(actor_items_before, actor.items)
def test_interact_gold_reward(self): house = random_building(min_gold=10, item=False) interaction = house.interaction actor = random_character_entity() actor_gold_before = actor.gold actor_items_before = actor.items.copy() entries = house.interact(actor) print(entries) self.assertEqual(actor_gold_before + interaction['gold'], actor.gold) self.assertEqual(actor_items_before, actor.items)
def test_interact_multiple_times(self): house = random_building() actor = random_character_entity() entries = house.interact(actor) print("-- FIRST VISIT --") print(entries) actor_gold_before = actor.gold actor_items_before = actor.items.copy() entries = house.interact(actor) print("-- SECOND VISIT --") print(entries) self.assertEqual(actor_gold_before, actor.gold) self.assertEqual(actor_items_before, actor.items)