INNER CODE UNIT · Python
assert_download_runs
operatorai/modelstore · workflows/actions/cli.py:50
def assert_download_runs(domain: str, model_id: str):
"""Runs the 'python -m modelstore download' command
in a temporary directory"""
with tempfile.TemporaryDirectory() as tmp_dir:
_run_cli_command(["download", domain, model_id, str(tmp_dir)])
model_dir = os.path.join(tmp_dir, domain, model_id)
assert os.path.exists(model_dir)
assert len(os.listdir(model_dir)) != 0
print(f"✅ CLI command downloaded model={model_id}")