Exemple #1
0
def test_group_principals_with_one_group():
    user = mock.Mock(groups=[_mock_group('pubid1')])

    assert auth.group_principals(user) == [
        'group:__world__',
        'group:pubid1',
    ]
Exemple #2
0
def test_group_principals_with_one_group():
    user = mock.Mock(groups=[_mock_group('pubid1')])

    assert auth.group_principals(user) == [
        'group:__world__',
        'group:pubid1',
    ]
Exemple #3
0
def test_group_principals_with_three_groups():
    user = mock.Mock(groups=[
        _mock_group('pubid1'),
        _mock_group('pubid2'),
        _mock_group('pubid3'),
    ])

    assert auth.group_principals(user) == [
        'group:pubid1',
        'group:pubid2',
        'group:pubid3',
    ]
Exemple #4
0
def test_group_principals_with_three_groups():
    user = mock.Mock(groups=[
        _mock_group('pubid1'),
        _mock_group('pubid2'),
        _mock_group('pubid3'),
    ])

    assert auth.group_principals(user) == [
        'group:__world__',
        'group:pubid1',
        'group:pubid2',
        'group:pubid3',
    ]
Exemple #5
0
def test_group_principals_with_no_groups():
    user = mock.Mock(groups=[])

    assert auth.group_principals(user) == ['group:__world__']
Exemple #6
0
def test_group_principals_with_three_groups():
    user = mock.Mock(groups=[_mock_group("hashid1"), _mock_group("hashid2"), _mock_group("hashid3")])

    assert auth.group_principals(user) == ["group:__world__", "group:hashid1", "group:hashid2", "group:hashid3"]
Exemple #7
0
def test_group_principals_with_no_groups():
    user = mock.Mock(groups=[])

    assert auth.group_principals(user) == ['group:__world__']