MCPcopy Create free account
hub / github.com/ashleve/rootutils / test_set_root

Function test_set_root

tests/test_rootutils.py:57–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55
56
57def test_set_root():
58 path = find_root(__file__)
59 assert path.exists()
60
61 os.chdir(path.parent)
62 assert os.getcwd() != str(path)
63
64 assert "PROJECT_ROOT" not in os.environ
65
66 set_root(path, project_root_env_var=True, dotenv=False, pythonpath=False, cwd=False)
67 assert "PROJECT_ROOT" in os.environ
68 assert os.environ["PROJECT_ROOT"] == str(path)
69 assert os.getcwd() != str(path)
70
71 set_root(path, project_root_env_var=True, dotenv=True, pythonpath=True, cwd=True)
72 assert os.getcwd() == str(path)
73 assert str(path) in sys.path
74
75
76def test_setup_root():

Callers

nothing calls this directly

Calls 2

find_rootFunction · 0.90
set_rootFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…