77from pathlib import Path
88from unittest import mock
99
10- from chipflow_lib import (
11- ChipFlowError ,
10+ from chipflow import ChipFlowError , ensure_chipflow_root
11+ from chipflow . cli import (
1212 _get_cls_by_reference ,
13- _ensure_chipflow_root ,
14- _parse_config
15- )
13+ _parse_config )
14+
1615from chipflow .config .parser import _parse_config_file
1716from chipflow .config_models import Config , ChipFlowConfig
1817# Process is not part of the public API, so we won't test it here
@@ -75,8 +74,8 @@ def test_ensure_chipflow_root_already_set(self):
7574 os .environ ["CHIPFLOW_ROOT" ] = "/test/path"
7675 sys .path = ["/some/other/path" ]
7776
78- _ensure_chipflow_root .root = None #type: ignore
79- result = _ensure_chipflow_root ()
77+ ensure_chipflow_root .root = None #type: ignore
78+ result = ensure_chipflow_root ()
8079
8180 self .assertEqual (result , Path ("/test/path" ))
8281 self .assertIn ("/test/path" , sys .path )
@@ -85,10 +84,10 @@ def test_ensure_chipflow_root_not_set(self):
8584 """Test _ensure_chipflow_root when CHIPFLOW_ROOT is not set"""
8685 if "CHIPFLOW_ROOT" in os .environ :
8786 del os .environ ["CHIPFLOW_ROOT" ]
88- _ensure_chipflow_root .root = None #type: ignore
87+ ensure_chipflow_root .root = None #type: ignore
8988
9089 with mock .patch ("os.getcwd" , return_value = "/mock/cwd" ):
91- result = _ensure_chipflow_root ()
90+ result = ensure_chipflow_root ()
9291
9392 self .assertEqual (result , Path ("/mock/cwd" ))
9493 self .assertEqual (os .environ ["CHIPFLOW_ROOT" ], "/mock/cwd" )
0 commit comments