-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[IO-1203] Missing dataset fields (#617)
* adding in missing items * test for slotted response * cleanup * changes on current_workflow * fixes for test
- Loading branch information
1 parent
0443392
commit f118ae6
Showing
3 changed files
with
42 additions
and
8 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
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,35 @@ | ||
import pytest | ||
|
||
from darwin.item import DatasetItem | ||
|
||
|
||
@pytest.fixture | ||
def response_json_slots() -> dict: | ||
return { | ||
"id": "test_id", | ||
"name": "test_filename", | ||
"path": "test_path", | ||
"status": "test_status", | ||
"archived": "test_archived", | ||
"dataset_id": "test_dataset_id", | ||
"dataset_slug": "test_dataset_slug", | ||
"seq": None, | ||
"workflow_data": {"workflow_id": "test_workflow_id"}, | ||
"workflow_status": "test_workflow_status", | ||
"slots": [{"size_bytes": 1, "path": "test_path"}], | ||
} | ||
|
||
|
||
def test_item_parse_w_slots(response_json_slots: dict) -> None: | ||
item = DatasetItem.parse(response_json_slots, "test_dataset_slug") | ||
assert item.id == response_json_slots["id"] | ||
assert item.filename == response_json_slots["name"] | ||
assert item.path == response_json_slots["path"] | ||
assert item.status == response_json_slots["status"] | ||
assert item.archived == response_json_slots["archived"] | ||
assert item.dataset_id == response_json_slots["dataset_id"] | ||
assert item.dataset_slug == "test_dataset_slug" | ||
assert item.seq == response_json_slots["seq"] | ||
assert item.current_workflow_id == response_json_slots["workflow_data"]["workflow_id"] | ||
assert item.current_workflow == response_json_slots["workflow_data"] | ||
assert item.slots == response_json_slots["slots"] |