def test_group_principals_with_one_group(): user = mock.Mock(groups=[_mock_group('pubid1')]) assert auth.group_principals(user) == [ 'group:__world__', 'group:pubid1', ]
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', ]
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', ]
def test_group_principals_with_no_groups(): user = mock.Mock(groups=[]) assert auth.group_principals(user) == ['group:__world__']
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"]