Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issue with github storage running in non-empty directories #6693

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests
  • Loading branch information
cicdw committed Sep 2, 2022
commit b9d09ac69032eafe6953350b37ad2e64dd7b07bd
9 changes: 2 additions & 7 deletions tests/test_filesystems.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,27 +141,22 @@ async def test_repository_default(self, monkeypatch):
class p:
returncode = 0

expected_path = Path(".").absolute()
mock = AsyncMock(return_value=p())
monkeypatch.setattr(prefect.filesystems, "run_process", mock)
g = GitHub(repository="prefect")
await g.get_directory()

assert mock.await_count == 1
assert mock.await_args[0][0] == f"git clone prefect {expected_path}"
assert f"git clone prefect" in mock.await_args[0][0]

async def test_reference_default(self, monkeypatch):
class p:
returncode = 0

expected_path = Path(".").absolute()
mock = AsyncMock(return_value=p())
monkeypatch.setattr(prefect.filesystems, "run_process", mock)
g = GitHub(repository="prefect", reference="2.0.0")
await g.get_directory()

assert mock.await_count == 1
assert (
mock.await_args[0][0]
== f"git clone prefect -b 2.0.0 --depth 1 {expected_path}"
)
assert f"git clone prefect -b 2.0.0 --depth 1" in mock.await_args[0][0]