Exemplo n.º 1
0
def test_match_target_custom_attribute_mismatch():
    target = {
        u'attribute': u'bazzle',
        u'op': u'in',
        u'values': [u'def']
    }
    assert util._match_target(target, user) == False
Exemplo n.º 2
0
def test_match_target_key_match():
    target = {
        u'attribute': u'key',
        u'op': u'in',
        u'values': ['xyz']
    }
    assert util._match_target(target, {'key': 'xyz'}) == True
Exemplo n.º 3
0
def test_match_target_key_empty():
    target = {
        u'attribute': u'key',
        u'op': u'in',
        u'values': []
    }
    assert util._match_target(target, {'key': 'xyz'}) == False
Exemplo n.º 4
0
def test_match_target_custom_attribute_mismatch():
    target = {u'attribute': u'bazzle', u'op': u'in', u'values': [u'def']}
    assert util._match_target(target, user) == False
Exemplo n.º 5
0
def test_match_target_key_match():
    target = {u'attribute': u'key', u'op': u'in', u'values': ['xyz']}
    assert util._match_target(target, {'key': 'xyz'}) == True
Exemplo n.º 6
0
def test_match_target_key_empty():
    target = {u'attribute': u'key', u'op': u'in', u'values': []}
    assert util._match_target(target, {'key': 'xyz'}) == False