-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SWAT-4] Revert breaking changes to dataset pull (#372)
- Loading branch information
1 parent
0495534
commit 639226a
Showing
3 changed files
with
38 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
__version__ = "0.7.11" | ||
__version__ = "0.7.12" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import shutil | ||
from unittest.mock import patch | ||
|
||
import requests | ||
from darwin.dataset.release import Release | ||
from tests.fixtures import * | ||
|
||
|
||
@pytest.fixture | ||
def release(dataset_slug: str, team_slug: str) -> Release: | ||
return Release( | ||
dataset_slug=dataset_slug, | ||
team_slug=team_slug, | ||
version="latest", | ||
name="test", | ||
url="http://test.v7labs.com/", | ||
export_date="now", | ||
image_count=None, | ||
class_count=None, | ||
available=True, | ||
latest=True, | ||
format="darwin", | ||
) | ||
|
||
|
||
def describe_release(): | ||
def it_downloads_zip(release: Release, tmp_path: Path): | ||
with patch.object(requests, "get") as get: | ||
with patch.object(shutil, "copyfileobj") as copyfileobj: | ||
release.download_zip(tmp_path / "test.zip") | ||
get.assert_called_once_with("http://test.v7labs.com/", stream=True) | ||
copyfileobj.assert_called_once() |