def test_does_not_match_superset(self): om = ObjectMatcher({'b': 2, 'c': 3}) self.assertFalse(om.matches({'a': 1, 'b': 2, 'c': 3}))
def test_matches_multiple_keys_out_of_order(self): om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3}) self.assertTrue(om.matches({'c': 3, 'b': 2, 'a': 1}))
def test_matches_subset(self): om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3}) self.assertTrue(om.matches({'b': 2, 'a': 1}))
def test_matches_multiple_keys_exactly(self): om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3}) self.assertTrue(om.matches({'a': 1, 'b': 2, 'c': 3}))
def test_matches_exactly(self): om = ObjectMatcher({'a': 1}) self.assertTrue(om.matches({'a': 1}))
def test_empty_set_always_matches(self): om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3}) self.assertTrue(om.matches({}))
def test_no_matching_empty_set(self): om = ObjectMatcher({}) self.assertFalse(om.matches({'a': 1}))
def test_creation(self): om = ObjectMatcher({}) self.assertTrue(om.matches({}))