Skip to content

Commit

Permalink
make tests work on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andyk committed Oct 14, 2021
1 parent cfdd20d commit 638f3ec
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions tests/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""
import pytest
import subprocess
import os
from pathlib import Path
from agentos import run_component

Expand Down Expand Up @@ -114,10 +115,16 @@ def run_component_in_dir(
)
params = entry_point_params[i]

run_cmd = (
f". {Path(venv.bin)}/activate; agentos "
f"run {component_name} --entry-point {entry_point} {params}"
)
if os.name == "nt":
run_cmd = (
f"{Path(venv.bin)}/activate.bat & agentos "
f"run {component_name} --entry-point {entry_point} {params}"
)
else:
run_cmd = (
f". {Path(venv.bin)}/activate; agentos "
f"run {component_name} --entry-point {entry_point} {params}"
)
print(
f"Using CLI to run the following command: {run_cmd} with "
f"cwd={dir_name}."
Expand Down

0 comments on commit 638f3ec

Please sign in to comment.