From cb3091fbdc1b337b0594bc3f1c31c9570bdc37e9 Mon Sep 17 00:00:00 2001 From: Jesse Snyder Date: Thu, 3 Aug 2023 17:25:53 -0700 Subject: [PATCH] Test fixes --- test/test_griduniverse.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/test/test_griduniverse.py b/test/test_griduniverse.py index cdc07a35..36fa535a 100755 --- a/test/test_griduniverse.py +++ b/test/test_griduniverse.py @@ -124,9 +124,9 @@ def test_new_experiment_has_a_grid(self, exp): def test_new_experiment_has_item_config_with_defaults(self, exp): item_config = exp.item_config assert isinstance(item_config, dict) - # We define item 9 as Food, and pull the null public good multiplier from the default - assert item_config[9]["name"] == "Food" - assert item_config[9]["public_good_multiplier"] == 0.0 + # We define a Food item, and pull the null public good multiplier from the default + assert item_config["food"]["name"] == "Food" + assert item_config["food"]["public_good_multiplier"] == 0.0 def test_new_experiment_has_transition_config_with_defaults(self, exp): transition_config = exp.transition_config @@ -135,8 +135,9 @@ def test_new_experiment_has_transition_config_with_defaults(self, exp): # We are keyed on tuples of item ids (actor, target) assert isinstance(key, tuple) assert len(key) == 2 - assert isinstance(key[0], int) - assert isinstance(key[1], int) + # ints or strings both supported for IDs + assert isinstance(key[0], (int, str)) + assert isinstance(key[1], (int, str)) # This value comes from the defaults assert transition["visible"] in {"always", "never", "seen"} break