Example #1
0
 def test_match_of_partial_top_level_keys(self):
     match = {"d": 3}
     value = {"a": {"b": 1, "c": 2}, "d": 3}
     self.assertTrue(is_match(match, value))
Example #2
0
 def test_match_of_partial_deep_nested_keys(self):
     match = {"a": {"b": 1}}
     value = {"a": {"b": 1, "c": 2}, "d": 3}
     self.assertTrue(is_match(match, value))
Example #3
0
 def test_match_of_partial_keys(self):
     match = {"a": 2, "b": 3}
     value = {"c": 4, "a": 2, "b": 3}
     self.assertTrue(is_match(match, value))
Example #4
0
def test_non_match_of_disjoint_keys():
    match = {"x": 1}
    value = {"a": {"b": 2, "c": 2}, "d": 3}
    assert not is_match(match, value)
Example #5
0
def test_non_match_of_partial_deep_nested_keys():
    match = {"a": {"b": 1}}
    value = {"a": {"b": 2, "c": 2}, "d": 3}
    assert not is_match(match, value)
Example #6
0
def test_match_of_partial_top_level_keys():
    match = {"d": 3}
    value = {"a": {"b": 1, "c": 2}, "d": 3}
    assert is_match(match, value)
Example #7
0
def test_match_of_partial_keys():
    match = {"a": 2, "b": 3}
    value = {"c": 4, "a": 2, "b": 3}
    assert is_match(match, value)