-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into BAI-1086-api-token-su…
…pport
- Loading branch information
Showing
9 changed files
with
383 additions
and
370 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from __future__ import annotations | ||
|
||
from io import BytesIO | ||
|
||
import pytest | ||
from bailo import Model | ||
|
||
|
||
@pytest.mark.integration | ||
def test_file_upload(integration_client, example_model: Model): | ||
byte_obj = b"Test Binary" | ||
file = BytesIO(byte_obj) | ||
|
||
example_release = example_model.create_release("0.1.0", "test") | ||
|
||
with file as file: | ||
file_id = example_release.upload("test", file) | ||
|
||
download_file = BytesIO() | ||
example_release.download(file_id, download_file) | ||
|
||
# Check that file uploaded has the same contents as the one downloaded | ||
download_file.seek(0) | ||
assert download_file.read() == byte_obj |
Oops, something went wrong.