()
| 14 | |
| 15 | |
| 16 | def test_find_root(): |
| 17 | path = find_root() |
| 18 | assert path.exists() |
| 19 | |
| 20 | path = find_root("") |
| 21 | assert path.exists() |
| 22 | |
| 23 | path = find_root(".") |
| 24 | assert path.exists() |
| 25 | |
| 26 | path = find_root(__file__) |
| 27 | assert path.exists() |
| 28 | |
| 29 | path = find_root(str(__file__)) |
| 30 | assert path.exists() |
| 31 | |
| 32 | path = find_root(Path(__file__)) |
| 33 | assert path.exists() |
| 34 | |
| 35 | path = find_root(__file__, ".git") |
| 36 | assert path.exists() |
| 37 | |
| 38 | path = find_root(__file__, indicator=[".setup.cfg", "setup.py", "LICENSE"]) |
| 39 | assert path.exists() |
| 40 | |
| 41 | with pytest.raises(FileNotFoundError): |
| 42 | path = find_root(__file__, indicator="abc") |
| 43 | |
| 44 | with pytest.raises(FileNotFoundError): |
| 45 | path = find_root(__file__, indicator=["abc", "def", "fgh"]) |
| 46 | |
| 47 | with pytest.raises(FileNotFoundError): |
| 48 | path = find_root(Path(__file__).parent.parent.parent) |
| 49 | |
| 50 | with pytest.raises(TypeError): |
| 51 | path = find_root([]) |
| 52 | |
| 53 | with pytest.raises(TypeError): |
| 54 | path = find_root("", ["abs", "def", 42]) |
| 55 | |
| 56 | |
| 57 | def test_set_root(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…