Example #1
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']
Example #2
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']
Example #3
0
 def test_secretkey(self):
     apikey = resolve_apikey()
     expected_secretkey = resolve_secretkey()
     returned_secretkey = monitis.user.secretkey()
     assert_equal(expected_secretkey, returned_secretkey)
Example #4
0
 def test_get(self):
     # this test needs a simple API call, secretkey fits the bill
     # http://www.monitis.com/api?action=secretkey&apikey=${MONITIS_APIKEY}
     secret_key = get(action='secretkey')['secretkey']
     assert_equals(secret_key,resolve_secretkey())
Example #5
0
 def test_resolve_secretkey(self):
     secretkey = resolve_secretkey()
     matched = match('^[0-9A-Z]{26}$', secretkey)
     assert matched is not None
Example #6
0
 def test_get(self):
     # this test needs a simple API call, secretkey fits the bill
     # http://www.monitis.com/api?action=secretkey&apikey=${MONITIS_APIKEY}
     secret_key = get(action='secretkey')['secretkey']
     assert_equals(secret_key, resolve_secretkey())
Example #7
0
 def test_resolve_secretkey(self):
     secretkey = resolve_secretkey()
     matched = match('^[0-9A-Z]{26}$', secretkey)
     assert matched is not None