Skip to content
Snippets Groups Projects
Commit a7312d4c authored by fheinrich's avatar fheinrich
Browse files

Fix tests

parent 9250ecc4
No related branches found
No related tags found
1 merge request!75Resolve "record relevent game events with hooks"
Pipeline #48235 passed
......@@ -207,13 +207,7 @@ extra_setup_functions:
log_path: USER_LOG_DIR/ENV_NAME/LOG_RECORD_NAME.jsonl
add_hook_ref: true
empty_info_msg:
func: !!python/name:cooperative_cuisine.hooks.hooks_via_callback_class ''
kwargs:
hooks: [ action_put ]
callback_class: !!python/name:cooperative_cuisine.info_msg.InfoMsgManager ''
callback_class_kwargs:
msg: ""
# info_msg:
# func: !!python/name:cooperative_cuisine.hooks.hooks_via_callback_class ''
# kwargs:
......
import pytest
from cooperative_cuisine.hooks import Hooks
from cooperative_cuisine.items import ItemInfo, CookingEquipment, Item, ItemType
......@@ -8,7 +9,7 @@ def test_can_combine_single_other_item():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
other_item = Item("Onion", ItemInfo(type=ItemType.Ingredient, name="Onion"))
......@@ -20,12 +21,13 @@ def test_can_combine_list_of_other_items():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
other_item = CookingEquipment(
name="Pan",
transitions={},
item_info=ItemInfo(type=ItemType.Equipment, name="Pan"),
hook=Hooks(None)
)
assert cooking_equipment.can_combine(other_item) == False
......@@ -36,7 +38,7 @@ def test_can_combine_without_other_item():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
assert cooking_equipment.can_combine(None) == False
......@@ -47,7 +49,7 @@ def test_combine():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
other_item = Item("Onion", ItemInfo(type=ItemType.Ingredient, name="Onion"))
......@@ -59,7 +61,7 @@ def test_progress():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
result = Item(name="TestResult", item_info=None)
cooking_equipment.active_transition = {
......@@ -78,7 +80,7 @@ def test_reset_content():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
cooking_equipment.content_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
cooking_equipment.reset_content()
......@@ -91,7 +93,7 @@ def test_release():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
cooking_equipment.content_list = ["Content1", "Content2"]
......@@ -105,7 +107,7 @@ def test_extra_repr_without_content():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
assert cooking_equipment.extra_repr == "[], None"
......@@ -116,7 +118,7 @@ def test_extra_repr_with_content():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
item_1 = Item(
......@@ -135,7 +137,7 @@ def test_get_potential_meal_without_content():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
assert cooking_equipment.get_potential_meal() is None
......@@ -146,7 +148,7 @@ def test_get_potential_meal_with_content():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
cooking_equipment = CookingEquipment(
transitions={}, name="Pot", item_info=item_info
transitions={}, name="Pot", item_info=item_info, hook=Hooks(None)
)
item_1 = Item(
......@@ -166,7 +168,7 @@ def test_get_potential_meal_with_content():
@pytest.fixture
def cooking_equipment():
item_info = ItemInfo(type=ItemType.Meal, name="Soup", seconds=5.0)
return CookingEquipment(transitions={}, name="Pot", item_info=item_info)
return CookingEquipment(transitions={}, name="Pot", item_info=item_info, hook=Hooks(None))
def test_reset(cooking_equipment):
......
......@@ -35,7 +35,7 @@ def test_serving_window():
plate_dispenser.plate_received
), "ServingWindow needs to update plate out of kitchen for ordered meal."
plate_dispenser.plate_received = False
plate = Plate(transitions={}, clean=True, item_info=None)
plate = Plate(transitions={}, clean=True, item_info=None, hook=Hooks(None))
plate.content_list = [Item(name="TestMeal", item_info=None)]
assert serving_window.can_drop_off(
item=plate
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment