Skip to content

Commit

Permalink
Merge pull request #35 from ll7/31-create-a-method-to-record-the-simu…
Browse files Browse the repository at this point in the history
…lation

chore: Add map definition to state recording test
  • Loading branch information
ll7 authored Jun 4, 2024
2 parents 99fc171 + 6261b81 commit 60ceb8a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_recording.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import pickle

from robot_sf.gym_env.robot_env import RobotEnv, VisualizableSimState
from robot_sf.nav.map_config import MapDefinition

def test_recording():
env = RobotEnv(
Expand All @@ -24,10 +25,13 @@ def test_recording():

# Load the recording
with open(os.path.join('recordings', filename), 'rb') as f:
recorded_states = pickle.load(f)
recorded_states, map_def = pickle.load(f)

# Check that the recording has the correct length
assert len(recorded_states) == 10

# Check that the recorded states are instances of VisualizableSimState
assert all(isinstance(state, VisualizableSimState) for state in recorded_states)

# Check that the map definition is an instance of MapDefinition
assert isinstance(map_def, MapDefinition)

0 comments on commit 60ceb8a

Please sign in to comment.