Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI committed Jul 1, 2023
1 parent d20c6ac commit a68f500
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -544,10 +544,13 @@ async def test_lazy_load(item_repo: ItemAsyncRepository, tag_repo: TagAsyncRepos
assert len(new_items) > 0
first_item_id = new_items[0].id
new_items[1].id
update_data = {"name": "A modified Name", "tag_names": ["A new tag"]}
update_data.update({"id": first_item_id}) # type: ignore
update_data = {
"name": "A modified Name",
"tag_names": ["A new tag"],
"id": first_item_id,
}
tags_to_add = await maybe_async(tag_repo.list(CollectionFilter("name", update_data.pop("tag_names", []))))
assert len(tags_to_add) > 0
update_data.update({"tags": tags_to_add}) # type: ignore
update_data["tags"] = tags_to_add
updated_obj = await maybe_async(item_repo.update(BigIntItem(**update_data)))
assert len(updated_obj.tags) > 0
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,13 @@ async def test_lazy_load(item_repo: ItemAsyncRepository, tag_repo: TagAsyncRepos
assert len(new_items) > 0
first_item_id = new_items[0].id
new_items[1].id
update_data = {"name": "A modified Name", "tag_names": ["A new tag"]}
update_data.update({"id": first_item_id}) # type: ignore
update_data = {
"name": "A modified Name",
"tag_names": ["A new tag"],
"id": first_item_id,
}
tags_to_add = await maybe_async(tag_repo.list(CollectionFilter("name", update_data.pop("tag_names", []))))
assert len(tags_to_add) > 0
update_data.update({"tags": tags_to_add}) # type: ignore
update_data["tags"] = tags_to_add
updated_obj = await maybe_async(item_repo.update(UUIDItem(**update_data)))
assert len(updated_obj.tags) > 0

0 comments on commit a68f500

Please sign in to comment.