| 55 | |
| 56 | |
| 57 | def 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 | |
| 76 | def test_setup_root(): |