Skip to content

Commit

Permalink
test equality
Browse files Browse the repository at this point in the history
  • Loading branch information
dmulcahey committed Jul 14, 2024
1 parent fa062d2 commit 7c82543
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/test_quirks_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ async def test_quirks_v2_multiple_matches_raises(device_mock):
"""Test that adding multiple quirks v2 entries for the same device raises."""
registry = DeviceRegistry()

(
entry1 = (
add_to_registry_v2(
device_mock.manufacturer, device_mock.model, registry=registry
)
Expand All @@ -206,7 +206,7 @@ async def test_quirks_v2_multiple_matches_raises(device_mock):
.build()
)

(
entry2 = (
add_to_registry_v2(
device_mock.manufacturer, device_mock.model, registry=registry
)
Expand All @@ -221,6 +221,8 @@ async def test_quirks_v2_multiple_matches_raises(device_mock):
.build()
)

assert entry1 != entry2

with pytest.raises(
MultipleQuirksMatchException, match="Multiple matches found for device"
):
Expand All @@ -235,7 +237,7 @@ async def test_quirks_v2_multiple_matches_not_raises(device_mock):
"""
registry = DeviceRegistry()

(
entry1 = (
add_to_registry_v2(
device_mock.manufacturer, device_mock.model, registry=registry
)
Expand All @@ -249,7 +251,7 @@ async def test_quirks_v2_multiple_matches_not_raises(device_mock):
.build()
)

(
entry2 = (
add_to_registry_v2(
device_mock.manufacturer, device_mock.model, registry=registry
)
Expand All @@ -263,6 +265,7 @@ async def test_quirks_v2_multiple_matches_not_raises(device_mock):
.build()
)

assert entry1 == entry2
assert isinstance(registry.get_device(device_mock), CustomDeviceV2)


Expand Down

0 comments on commit 7c82543

Please # to comment.