コード例 #1
0
def test_no_api_key_leak():
    cs = CloudService()
    cs.enable('test_key_true')
    config = cs.get_config()
    assert 'api_key' not in config
    assert 'test_key_true' not in config.values()
コード例 #2
0
def test_auth_error():
    cs = CloudService()
    cs.enable('test_key_false')
    conf = cs.get_config()
    assert not conf['enabled']
    assert conf['status'] == AUTH_ERROR
コード例 #3
0
def test_enabled_and_status_ok():
    cs = CloudService()
    cs.enable('test_key_true')
    conf = cs.get_config()
    assert conf['enabled']
    assert conf['status'] == OK
コード例 #4
0
def test_enabled_and_status_in_sync():
    cs = CloudService()
    conf = cs.get_config()
    assert not conf['enabled']
    assert conf['status'] == DISABLE
コード例 #5
0
def test_is_serializable():
    cs = CloudService()
    cs.enable('test_key_true')
    config = cs.get_config()
    assert json.loads(json.dumps(config)) == config
コード例 #6
0
def test_is_enable_and_status_ok():
    cs = CloudService()
    cs.enable("test_key_true")
    conf = cs.to_config()
    assert conf['is_enable']
    assert conf['status'] == OK
コード例 #7
0
def test_auth_error():
    cs = CloudService()
    cs.enable("test_key_false")
    conf = cs.to_config()
    assert not conf['is_enable']
    assert conf['status'] == AUTH_ERROR
コード例 #8
0
def test_is_enable_and_status_in_sync():
    cs = CloudService()
    conf = cs.to_config()
    assert not conf['is_enable']
    assert conf['status'] == DISABLE