GeezerVison is showing github.com — review · gitpython-developers/GitPython@afbbabf
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: test/test_assure_directory.py +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
|
8 | 8 |
|
9 | 9 | @pytest.fixture |
10 | 10 | def directory_fixture(monkeypatch): |
11 | | - with writable_fixture("assure-directory.sh") as temporary: |
| 11 | + with writable_fixture("empty.sh") as temporary: |
12 | 12 | directory = temporary.path().resolve() |
13 | 13 | with monkeypatch.context() as context: |
14 | 14 | context.chdir(directory) |
@@ -32,11 +32,13 @@ def test_nested_file_creates_only_missing_parent_directories(directory_fixture, |
32 | 32 |
|
33 | 33 | @pytest.mark.parametrize("path_type", [str, Path]) |
34 | 34 | def test_existing_directory_is_unchanged(directory_fixture, path_type): |
| 35 | + (directory_fixture / "existing").mkdir() |
35 | 36 | assert assure_directory_exists(path_type("existing")) is False |
36 | 37 |
|
37 | 38 |
|
38 | 39 | @pytest.mark.parametrize("path_type", [str, Path]) |
39 | 40 | def test_file_cannot_be_used_as_parent_directory(directory_fixture, path_type): |
| 41 | + (directory_fixture / "blocked").write_text("occupied\n") |
40 | 42 | with pytest.raises(FileExistsError): |
41 | 43 | assure_directory_exists(path_type("blocked/notes.txt"), is_file=True) |
42 | 44 | assert (directory_fixture / "blocked").read_text() == "occupied\n" |
Collapse file
Copy file name to clipboardExpand all lines: tests/fixtures/assure-directory.sh -4Lines changed: 0 additions & 4 deletions