Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Add map definition to state recording test #35

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
Loading