Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from io import StringIO
from unittest import mock

from chipflow_lib import ChipFlowError
from chipflow import ChipFlowError
from chipflow.cli import run
from chipflow.config_models import Config, ChipFlowConfig

Expand Down
17 changes: 8 additions & 9 deletions tests/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
from pathlib import Path
from unittest import mock

from chipflow_lib import (
ChipFlowError,
from chipflow import ChipFlowError, ensure_chipflow_root
from chipflow.cli import (
_get_cls_by_reference,
_ensure_chipflow_root,
_parse_config
)
_parse_config)

from chipflow.config.parser import _parse_config_file
from chipflow.config_models import Config, ChipFlowConfig
# Process is not part of the public API, so we won't test it here
Expand Down Expand Up @@ -75,8 +74,8 @@ def test_ensure_chipflow_root_already_set(self):
os.environ["CHIPFLOW_ROOT"] = "/test/path"
sys.path = ["/some/other/path"]

_ensure_chipflow_root.root = None #type: ignore
result = _ensure_chipflow_root()
ensure_chipflow_root.root = None #type: ignore
result = ensure_chipflow_root()

self.assertEqual(result, Path("/test/path"))
self.assertIn("/test/path", sys.path)
Expand All @@ -85,10 +84,10 @@ def test_ensure_chipflow_root_not_set(self):
"""Test _ensure_chipflow_root when CHIPFLOW_ROOT is not set"""
if "CHIPFLOW_ROOT" in os.environ:
del os.environ["CHIPFLOW_ROOT"]
_ensure_chipflow_root.root = None #type: ignore
ensure_chipflow_root.root = None #type: ignore

with mock.patch("os.getcwd", return_value="/mock/cwd"):
result = _ensure_chipflow_root()
result = ensure_chipflow_root()

self.assertEqual(result, Path("/mock/cwd"))
self.assertEqual(os.environ["CHIPFLOW_ROOT"], "/mock/cwd")
Expand Down
Loading