Skip to content

Commit

Permalink
test: Create directory if it doesn't exist in test_can_load_model_sna…
Browse files Browse the repository at this point in the history
…pshot()
  • Loading branch information
ll7 committed Sep 25, 2024
1 parent 389db5d commit 4e4e179
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/sb3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
from robot_sf.gym_env.robot_env import RobotEnv
from robot_sf.feature_extractor import DynamicsExtractor


def test_can_load_model_snapshot():
MODEL_PATH = "./temp/ppo_model"
MODEL_FILE = f"{MODEL_PATH}.zip"

# Create the directory if it doesn't exist
os.makedirs(os.path.dirname(MODEL_PATH), exist_ok=True)

if os.path.exists(MODEL_FILE) and os.path.isfile(MODEL_FILE):
os.remove(MODEL_FILE)

Expand Down

0 comments on commit 4e4e179

Please sign in to comment.