コード例 #1
0
def main():
    hub_id = hub.default()

    print(
        hub_api.tz(host=hub.host(hub_id),
                   cloud_token=cloud.token(),
                   hub_token=hub.token(hub_id),
                   remote=True))
コード例 #2
0
def main(statepath):
    config.setStatePath(statepath)

    cloud_token = cloud.token()
    hub_id = hub.default()
    hub_token = hub.token(hub_id)

    pp = pprint.PrettyPrinter(indent=2)
    for token in cloud_token, hub_token:
        claims = jwt.decode(token, verify=False)
        pp.pprint(claims)
コード例 #3
0
ファイル: test_hub.py プロジェクト: Artanicus/python-cozify
def test_hub_fill_kwargs(live_hub):
    assert hub.ping()
    kwargs = {}
    hub._fill_kwargs(kwargs)
    for key in [
            'hub_id', 'remote', 'autoremote', 'hub_token', 'cloud_token',
            'host'
    ]:
        assert key in kwargs, 'key {0} did not get set.'.format(key)
        if key != 'host' or (key == 'host'
                             and not live_hub.remote(hub.default())):
            assert kwargs[key] is not None, 'key {0} was set to None'.format(
                key)
コード例 #4
0
def main(start=hub_api.apiPath):
    hub_id = hub.default()
    host = hub.host(hub_id)
    token = hub.token(hub_id)
    api_ver = start
    base = hub_api._getBase(host)

    print('Testing against {0}, starting from {1}{2}'.format(hub_id, base, start))

    while True:
        if not ping(base + api_ver, token):
            print('Fail: {0}'.format(api_ver))
        else:
            print('Works: {0}'.format(api_ver))
            break
        api_ver = increment(api_ver)