Ejemplo n.º 1
0
 def test_does_not_match_superset(self):
     om = ObjectMatcher({'b': 2, 'c': 3})
     self.assertFalse(om.matches({'a': 1, 'b': 2, 'c': 3}))
Ejemplo n.º 2
0
 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}))
Ejemplo n.º 3
0
 def test_matches_subset(self):
     om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3})
     self.assertTrue(om.matches({'b': 2, 'a': 1}))
Ejemplo n.º 4
0
 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}))
Ejemplo n.º 5
0
 def test_matches_exactly(self):
     om = ObjectMatcher({'a': 1})
     self.assertTrue(om.matches({'a': 1}))
Ejemplo n.º 6
0
 def test_empty_set_always_matches(self):
     om = ObjectMatcher({'a': 1, 'b': 2, 'c': 3})
     self.assertTrue(om.matches({}))
Ejemplo n.º 7
0
 def test_no_matching_empty_set(self):
     om = ObjectMatcher({})
     self.assertFalse(om.matches({'a': 1}))
Ejemplo n.º 8
0
 def test_creation(self):
     om = ObjectMatcher({})
     self.assertTrue(om.matches({}))