From 638f3ec56315ffc0acc5ac76fe8c5a432c378b3e Mon Sep 17 00:00:00 2001 From: Andy Konwinski Date: Wed, 13 Oct 2021 20:20:59 -0700 Subject: [PATCH] make tests work on windows --- tests/test_core.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/test_core.py b/tests/test_core.py index 3ff29929..6f2aa127 100644 --- a/tests/test_core.py +++ b/tests/test_core.py @@ -4,6 +4,7 @@ """ import pytest import subprocess +import os from pathlib import Path from agentos import run_component @@ -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}."