Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Cooperative Cuisine Environment
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Social Cognitive Systems
CoCoSy
Cooperative Cuisine Environment
Commits
a7312d4c
Commit
a7312d4c
authored
1 year ago
by
fheinrich
Browse files
Options
Downloads
Patches
Plain Diff
Fix tests
parent
9250ecc4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!75
Resolve "record relevent game events with hooks"
Pipeline
#48235
passed
1 year ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
cooperative_cuisine/configs/environment_config.yaml
+1
-7
1 addition, 7 deletions
cooperative_cuisine/configs/environment_config.yaml
tests/test_cooking_equipment.py
+14
-12
14 additions, 12 deletions
tests/test_cooking_equipment.py
tests/test_counter.py
+1
-1
1 addition, 1 deletion
tests/test_counter.py
with
16 additions
and
20 deletions
cooperative_cuisine/configs/environment_config.yaml
+
1
−
7
View file @
a7312d4c
...
...
@@ -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:
...
...
This diff is collapsed.
Click to expand it.
tests/test_cooking_equipment.py
+
14
−
12
View file @
a7312d4c
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
):
...
...
This diff is collapsed.
Click to expand it.
tests/test_counter.py
+
1
−
1
View file @
a7312d4c
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment