def test_apikey(self):
     expected_apikey = resolve_apikey()
     username = os.environ.get('MONITIS_USER')
     password = os.environ.get('MONITIS_PASS')
     returned_apikey = monitis.user.apikey(username=username,
                                           password=password)
     assert_equal(expected_apikey, returned_apikey)
Exemple #2
0
def secretkey(apikey=None):
    ''' The secret key associated with the given API key '''

    if apikey is None:
        apikey = resolve_apikey()

    return get(action='secretkey', apikey=apikey)['secretkey']
Exemple #3
0
def secretkey(apikey=None):
    ''' The secret key associated with the given API key '''

    if apikey is None:
        apikey = resolve_apikey()

    return get(action='secretkey', apikey=apikey)['secretkey']
Exemple #4
0
def auth_token(apikey=None, secretkey=None):
    ''' Generate an auth token

    If the apikey and/or secretkey are not specified as parameters,
    then they will be resolved, if possible.
    '''

    if apikey is None:
        apikey = resolve_apikey()

    if secretkey is None:
        secretkey = resolve_secretkey()

    return get(action='authToken', apikey=apikey,
               secretkey=secretkey)['authToken']
Exemple #5
0
def auth_token(apikey=None, secretkey=None):
    ''' Generate an auth token

    If the apikey and/or secretkey are not specified as parameters,
    then they will be resolved, if possible.
    '''

    if apikey is None:
        apikey = resolve_apikey()

    if secretkey is None:
        secretkey = resolve_secretkey()

    return get(action='authToken', apikey=apikey,
               secretkey=secretkey)['authToken']
 def test_secretkey(self):
     apikey = resolve_apikey()
     expected_secretkey = resolve_secretkey()
     returned_secretkey = monitis.user.secretkey()
     assert_equal(expected_secretkey, returned_secretkey)
Exemple #7
0
 def test_resolve_apikey(self):
     apikey = resolve_apikey()
     # apikey is a string of exactly 26 uppercase alphanumeric characters
     matched = match('^[0-9A-Z]{26}$', apikey)
     assert matched is not None
Exemple #8
0
 def test_resolve_apikey(self):
     apikey = resolve_apikey()
     # apikey is a string of exactly 26 uppercase alphanumeric characters
     matched = match('^[0-9A-Z]{26}$', apikey)
     assert matched is not None