Esempio n. 1
0
def test_verity_app_access():
	groups = [(appname_prefix + "-" + 'foo1').replace('.', '-'),
        (appname_prefix + "-" + 'foo2').replace('.', '-'),
        (appname_prefix + "-" + 'foo3').replace('.', '-')]
	success = Authorize.verify_app_access(groups, 'foo1')
	assert success
	success = Authorize.verify_app_access(groups, 'foo')
	assert not success
	success = Authorize.verify_app_access([], '')
	assert not success
	success = Authorize.verify_app_access([], None)
	assert not success
Esempio n. 2
0
def test_verity_app_access():
    groups = [(appname_prefix + "-" + 'foo1').replace('.', '-'),
              (appname_prefix + "-" + 'foo2').replace('.', '-'),
              (appname_prefix + "-" + 'foo3').replace('.', '-')]
    success = Authorize.verify_app_access(groups, 'foo1')
    assert success
    success = Authorize.verify_app_access(groups, 'foo')
    assert not success
    success = Authorize.verify_app_access([], '')
    assert not success
    success = Authorize.verify_app_access([], None)
    assert not success
Esempio n. 3
0
def test_verity_app_access():
    groups = [
        group_prefix + hashlib.md5(appname_prefix + 'foo1').hexdigest()[0:30],
        group_prefix + hashlib.md5(appname_prefix + 'foo2').hexdigest()[0:30],
        group_prefix + hashlib.md5(appname_prefix + 'foo3').hexdigest()[0:30]
    ]
    success = Authorize.verify_app_access(groups, 'foo1')
    assert success
    success = Authorize.verify_app_access(groups, 'foo')
    assert not success
    success = Authorize.verify_app_access([], '')
    assert not success
    success = Authorize.verify_app_access([], None)
    assert not success