def test_group_principals_with_three_groups(): user = mock.Mock(groups=[ _mock_group('pubid1'), _mock_group('pubid2'), _mock_group('pubid3'), ]) assert util.group_principals(user) == [ 'group:pubid1', 'group:pubid2', 'group:pubid3', ]
def test_group_principals_with_one_group(): user = mock.Mock(groups=[_mock_group('pubid1')]) assert util.group_principals(user) == ['group:pubid1']
def test_group_principals_with_no_groups(): user = mock.Mock(groups=[]) assert util.group_principals(user) == []