Example #1
0
def test_match_multiple():
    a = {'foo1': 'bar1', 'foo2': 'bar2'}
    b = {'foo1': 'bar1', 'foo2': 'bar2'}
    assert match(a, b)
Example #2
0
def test_match_multiple_fail():
    a = {'foo1': 'bar1', 'foo2': 'bar2'}
    b = {'foo1': 'bar1', 'foo2': 'baz1'}
    assert not match(a, b)
Example #3
0
def test_match_partial():
    a = {'foo': 'bar'}
    b = {'foo': 'bar baz'}
    assert match(a, b)
Example #4
0
def test_attr_match():
    a = {'foo': 'bar'}
    b = {'foo': 'bar'}
    assert match(a, b)
def test_match_partial():
    a = {"foo": "bar"}
    b = {"foo": "bar baz"}
    assert match(a, b)
Example #6
0
def test_match_empty_attrs_fail():
    a = {'foo': 'bar'}
    b = {}
    assert not match(a, b)
def test_multiple_strict_fail():
    a = {"foo1": "bar1", "foo2": "bar2"}
    b = {"foo1": "bar1 baz1", "foo2": "bar2"}
    assert not match(a, b, strict=True)
Example #8
0
def test_multiple_strict_fail():
    a = {'foo1': 'bar1', 'foo2': 'bar2'}
    b = {'foo1': 'bar1 baz1', 'foo2': 'bar2'}
    assert not match(a, b, strict=True)
def test_match_query_too_much_fail():
    a = {"foo1": "bar1 baz1", "foo2": "bar2"}
    b = {"foo1": "bar1", "foo2": "bar2"}
    assert not match(a, b)
Example #10
0
def test_match_multiple_partial():
    a = {"foo1": "bar1", "foo2": "bar2"}
    b = {"foo1": "bar1 baz1", "foo2": "bar2"}
    assert match(a, b)
Example #11
0
def test_match_multiple_fail():
    a = {"foo1": "bar1", "foo2": "bar2"}
    b = {"foo1": "bar1", "foo2": "baz1"}
    assert not match(a, b)
Example #12
0
def test_match_multiple():
    a = {"foo1": "bar1", "foo2": "bar2"}
    b = {"foo1": "bar1", "foo2": "bar2"}
    assert match(a, b)
Example #13
0
def test_attr_match():
    a = {"foo": "bar"}
    b = {"foo": "bar"}
    assert match(a, b)
Example #14
0
def test_match_query_too_much_fail():
    a = {'foo1': 'bar1 baz1', 'foo2': 'bar2'}
    b = {'foo1': 'bar1', 'foo2': 'bar2'}
    assert not match(a, b)
Example #15
0
def test_attr_match_query_empty():
    a = {}
    b = {"foo": "bar"}
    assert match(a, b)
Example #16
0
def test_match_multiple_partial():
    a = {'foo1': 'bar1', 'foo2': 'bar2'}
    b = {'foo1': 'bar1 baz1', 'foo2': 'bar2'}
    assert match(a, b)
Example #17
0
def test_match_empty_empty():
    a = {}
    b = {}
    assert match(a, b)
Example #18
0
def test_attr_match_query_empty():
    a = {}
    b = {'foo': 'bar'}
    assert match(a, b)
Example #19
0
def test_match_empty_attrs_fail():
    a = {"foo": "bar"}
    b = {}
    assert not match(a, b)