def test_should_retrieve_list_of_teams(get_me, get_teams):

    # Arrange
    name = 'User 1'
    get_me.return_value = GET_ME_RETURN_VALUE
    get_teams.return_value = [{'id': '1', 'name': name}]
    client = MondayClient(USERNAME, '', '')

    # Act
    teams = client.get_teams()

    # Assert
    ok_(teams != None)
    eq_(len(teams), 1)
    eq_(teams[0].name, name)
示例#2
0
def test_team_should_retrieve_list_of_users(get_users, get_teams, get_me):

    # Arrange 
    get_me.return_value = GET_ME_RETURN_VALUE
    get_teams.return_value = [{'id': '1', 'name': 'Team 1'}]
    client = MondayClient(USERNAME, '', '')
    team = client.get_teams()[0]

    get_teams.return_value = [{'id': '1', 'users':[{'id': '1', 'email': '*****@*****.**'}]}]

    # Act 
    users = team.get_users()

    # Assert
    ok_(users != None)
    eq_(len(users), 1)
    eq_(users[0].email, '*****@*****.**')