Skip to content

Commit

Permalink
Merge branch 'master' into py-401
Browse files Browse the repository at this point in the history
  • Loading branch information
JBWilkie authored Nov 14, 2023
2 parents 8f24ac2 + c638ce8 commit ca73356
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 4 deletions.
3 changes: 2 additions & 1 deletion darwin/future/core/items/move_items_to_folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def move_list_of_items_to_folder(
if isinstance(dataset_ids, list)
else [dataset_ids],
**filters,
}
},
"path": path,
}

return client.post(f"/v2/teams/{team_slug}/items/path", data=payload)
3 changes: 2 additions & 1 deletion darwin/future/core/items/set_item_priority.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ def set_item_priority(
if isinstance(dataset_ids, list)
else [dataset_ids],
**filters,
}
},
"priority": priority,
}

return client.post(
Expand Down
2 changes: 2 additions & 0 deletions darwin/future/meta/queries/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def restore(self) -> None:
and "dataset_id" not in self.meta_params
):
raise ValueError("Must specify dataset_ids to query items")
if not path:
raise ValueError("Must specify path to move items to")
dataset_ids = (
self.meta_params["dataset_ids"]
if "dataset_ids" in self.meta_params
Expand Down
6 changes: 4 additions & 2 deletions darwin/future/tests/meta/objects/test_itemmeta.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
from uuid import UUID

import pytest
import responses
from responses import json_params_matcher

from darwin.future.data_objects.item import ItemLayout, ItemSlot
from darwin.future.exceptions import BadRequest
from darwin.future.meta.objects.item import Item
from darwin.future.tests.meta.objects.fixtures import *

Expand Down Expand Up @@ -45,7 +47,7 @@ def test_delete(item: Item) -> None:
)
item.delete()


def test_restore(item: Item) -> None:
with responses.RequestsMock() as rsps:
team_slug = item.meta_params["team_slug"]
Expand All @@ -66,4 +68,4 @@ def test_restore(item: Item) -> None:
],
json={},
)
item.restore()
item.restore()
1 change: 1 addition & 0 deletions darwin/future/tests/meta/queries/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from responses.matchers import json_params_matcher, query_param_matcher

from darwin.future.core.client import ClientCore
from darwin.future.exceptions import BadRequest
from darwin.future.meta.objects.item import Item
from darwin.future.meta.queries.item import ItemQuery
from darwin.future.tests.core.fixtures import *
Expand Down

0 comments on commit ca73356

Please sign in to comment.