Skip to content

Commit

Permalink
Merge pull request #88 from mulkieran/test_deterministic
Browse files Browse the repository at this point in the history
Exercise another path with deterministic tests
  • Loading branch information
mulkieran authored May 1, 2023
2 parents 4090bb8 + b9a2f52 commit c79b8a5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion tests/test_deterministic.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

# isort: LOCAL
from dbus_client_gen import GMOQuery, managed_object_class, mo_query_builder
from dbus_client_gen._errors import DbusClientGenerationError
from dbus_client_gen._errors import (
DbusClientGenerationError,
DbusClientUniqueResultError,
)


class DeterministicTestCase(unittest.TestCase):
Expand Down Expand Up @@ -45,3 +48,12 @@ def test_unique_match(self):
self.assertEqual(len(search_result), 1)

self.assertEqual(search_result[0], test_item)

def test_unique_match_failure(self):
"""
Fail to get the unique match because no match criterion provided.
"""
with self.assertRaises(DbusClientUniqueResultError):
GMOQuery(
"interface_name", {"prop_name": "prop_value"}
).require_unique_match().search({})

0 comments on commit c79b8a5

Please sign in to comment.