コード例 #1
0
def test_error_on_authentication_with_wrong_username():
    """Tests if it throws error on authentication with wrong username"""
    with pytest.raises(CrowdAIRemoteException):
        api = CROWDAI_API(AUTH_TOKEN)
        api.authenticate_participant_with_username(str(uuid.uuid4()))
        assert api.participant_id is not False
コード例 #2
0
def test_valid_api_authentication_with_username():
    """Tests if we can authenticate with valid username"""
    api = CROWDAI_API(AUTH_TOKEN)
    api.authenticate_participant_with_username("spMohanty")
    assert api.participant_id is not False