Skip to content

Commit

Permalink
fix: mock call asserts in the package manager tests
Browse files Browse the repository at this point in the history
  • Loading branch information
angrybayblade committed Oct 6, 2023
1 parent 9f21bb8 commit d301cb7
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions tests/test_package_manager/test_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ def test_sync(

with mock.patch.object(pm, "add_package") as update_patch:
pm.sync(dev=True, third_party=False)
update_patch.assert_called_with(package_id=DUMMY_PACKAGE_ID)
update_patch.assert_called_with(
package_id=DUMMY_PACKAGE_ID.with_hash(
"bafybei0000000000000000000000000000000000000000000000000000"
),
with_dependencies=True,
)

# test package already exists.
with mock.patch.object(pm, "add_package") as update_patch, mock.patch(
Expand Down Expand Up @@ -204,7 +209,12 @@ def test_sync(

with mock.patch.object(pm, "add_package") as update_patch:
pm.sync(dev=False, third_party=True)
update_patch.assert_called_with(package_id=DUMMY_PACKAGE_ID)
update_patch.assert_called_with(
package_id=DUMMY_PACKAGE_ID.with_hash(
"bafybei0000000000000000000000000000000000000000000000000000"
),
with_dependencies=True,
)

# 3d part hashes
pm = PackageManagerV1(
Expand All @@ -214,7 +224,12 @@ def test_sync(

with mock.patch.object(pm, "add_package") as update_patch:
pm.sync(dev=False, third_party=True, update_hashes=True)
update_patch.assert_called_with(package_id=DUMMY_PACKAGE_ID)
update_patch.assert_called_with(
package_id=DUMMY_PACKAGE_ID.with_hash(
"bafybei0000000000000000000000000000000000000000000000000000"
),
with_dependencies=True,
)

# 3d part packages
with mock.patch.object(pm, "update_package") as update_patch, mock.patch.object(
Expand Down

0 comments on commit d301cb7

Please sign in to comment.