Esempio n. 1
0
def test_remove_raises_if_no_file(
    tmp_path: Path, sync_filesystem: SyncFilesystem
) -> None:
    """It should raise a PathNotFoundError error if file to remove isn't found."""
    path = tmp_path / "foo"

    with pytest.raises(PathNotFoundError):
        sync_filesystem.remove(path)
Esempio n. 2
0
def test_remove_deletes_file(tmp_path: Path, sync_filesystem: SyncFilesystem) -> None:
    """It should delete a given file."""
    path = tmp_path / "foo"
    path.with_suffix(".json").touch()

    sync_filesystem.remove(path)

    assert path.exists() is False