#2845: Pre-commit fixes

This commit is contained in:
Nick Todd
2024-09-03 17:24:21 +01:00
parent 61add769c4
commit 1822e85eec

View File

@@ -1,10 +1,13 @@
# © Crown-owned copyright 2024, Defence Science and Technology Laboratory UK
import json
from primaite.session.environment import PrimaiteGymEnv
from primaite.session.io import PrimaiteIO
import json
from tests import TEST_ASSETS_ROOT
DATA_MANIPULATION_CONFIG = TEST_ASSETS_ROOT / "configs" / "data_manipulation.yaml"
def test_obs_data_in_log_file():
"""Create a log file of AgentHistoryItems and check observation data is
included. Assumes that data_manipulation.yaml has an agent labelled
@@ -19,7 +22,7 @@ def test_obs_data_in_log_file():
env.reset()
io = PrimaiteIO()
path = io.generate_agent_actions_save_path(episode=1)
with open(path, 'r') as f:
with open(path, "r") as f:
j = json.load(f)
assert type(j['0']['defender']['obs_space_data']) == dict
assert type(j["0"]["defender"]["obs_space_data"]) == dict