def test_active():
    restart()
    authRegisterDict1 = auth_register("*****@*****.**","123456","Tim","Hu")
    token1 = authRegisterDict1["token"]
    channel_id = channels_create(token1,'test1',True)
    standup_start(token1,channel_id, 20)
    standup_active(token1, 1)
    with pytest.raises(ValueError, match=r'.*'):
        standup_active(token1, -5)
def run_standup_active():
    request_data = request.args

    return_value = standup.standup_active(request_data["token"],
                                          int(request_data["channel_id"]))

    return dumps(return_value)
Example #3
0
def test_standup_active():
    reset_data()
    #SETUP Begin
    authRegDict1 = auth_register("*****@*****.**", "qwerty", "John", "Smith")
    token1 = authRegDict1['token']
    channelCreateDict1 = channels_create(token1, 'New Channel', True)
    channel_id1 = channelCreateDict1['channel_id']

    authRegDict2 = auth_register("*****@*****.**", "asdfgh", "Jim", "Smith")
    token2 = authRegDict2['token']


    assert standup_active(token1, channel_id1) == {'is_active' : False, 'time_finish' : None}
    standup_start(token1, channel_id1, 5)
    standup_dic = standup_active(token1, channel_id1)
    assert standup_dic['is_active']

    with pytest.raises(ValueError):
        standup_active(token1, 10)

    with pytest.raises(AccessError):
        standup_active(token2, channel_id1)

    auth_logout(token1)
    auth_logout(token2)
Example #4
0
def active():
    token = request.args.get('token')
    channel_id = request.args.get('channel_id')
    result = standup_active(token, channel_id)
    return dumps(result)
Example #5
0
def stndup_act():
    ''' Route to check if a standup is activvin an existing channel'''
    return standup_active(request.args.get('token'),
                          request.args.get('channel_id'))
Example #6
0
def standupactive():
    token = get_args('token')
    channel_id = int(get_args('channel_id'))

    return dumps(standup_active(token, channel_id))