Exemplo n.º 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()
Exemplo n.º 2
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
Exemplo n.º 3
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
Exemplo n.º 4
0
def test_is_serializable():
    cs = CloudService()
    cs.enable('test_key_true')
    config = cs.get_config()
    assert json.loads(json.dumps(config)) == config
Exemplo n.º 5
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
Exemplo n.º 6
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