Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cguardia committed Aug 17, 2023
1 parent 45f85c0 commit 53fa875
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion dlgr/griduniverse/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,11 @@ def deserialize(self, state):
self.item_locations[tuple(obj.position)] = obj

def instructions(self):
with open("templates/instructions/instruct-ready.html") as instructions_file:
instructions_file_path = os.path.join(
os.path.dirname(__file__),
"templates/instructions/instruct-ready.html"
)
with open(instructions_file_path) as instructions_file:
instructions_html = instructions_file.read()
return instructions_html

Expand Down
4 changes: 2 additions & 2 deletions test/test_griduniverse.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def test_new_experiment_has_item_config_with_defaults(self, exp):
item_config = exp.item_config
assert isinstance(item_config, dict)
# 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
assert item_config["stone"]["name"] == "Stone"
assert item_config["stone"]["public_good_multiplier"] == 0.0

def test_new_experiment_has_transition_config_with_defaults(self, exp):
transition_config = exp.transition_config
Expand Down

0 comments on commit 53fa875

Please sign in to comment.