Ejemplo n.º 1
0
    def test_adding_existing_team_to_org(self):
        target_org = mock_org('target-org', team_names=['Read', 'Write'])

        read = mock_team('Read', target_org.login())
        write = mock_team('Write', target_org.login())

        assert target_org.teams() == [read, write]

        target_org.create_team('Read')

        assert target_org.teams() == [read, write]
Ejemplo n.º 2
0
    def test_team_with_initial_teams_has_them(self):
        target_org = mock_org('target-org',
                              team_names=['Read', 'Write', 'Admin'])

        read = mock_team('Read', target_org.login())
        write = mock_team('Write', target_org.login())
        admin = mock_team('Admin', target_org.login())

        org_teams = target_org.teams()
        assert org_teams == [read, write, admin]

        for actual_team in org_teams:
            assert actual_team.repositories() == []
        assert read.members() == []
Ejemplo n.º 3
0
    def test_adding_existing_member(self):
        team1 = mock_team('Team1', mock_org('target_org',
                                            team_names=['Team1']))
        assert team1.members() == []
        me = mock_user('me')

        team1.grant_access(me.login())
        assert team1.members() == [me]

        team1.grant_access(me.login())
        assert team1.members() == [me]
Ejemplo n.º 4
0
    def test_promote_existing_member(self):
        team1 = mock_team('Team1', mock_org('target_org',
                                            team_names=['Team1']))
        assert team1.members() == []
        me = mock_user('me')

        team1.grant_access(me.login())
        assert team1.members() == [me]

        team1.grant_access(me.login(), 'maintainer')
        assert team1.members() == [me]
        assert team1.members(role='member') == []
        assert team1.members(role='maintainer') == [me]