Ejemplo n.º 1
0
def test_remove_config():
    adapter = SQLiteAdapter(MEMORY_DBNAME)
    store_val = {"val1": True, "val2": None, "val3": 1.4}
    adapter.store_config("myconf", store_val)
    adapter.store_config("myconf2", store_val)
    removed = adapter.remove_config("myconf")
    assert removed
    read_val = adapter.read_config("myconf")
    assert read_val is None
    read_val = adapter.read_config("myconf2")
    assert read_val == store_val

    removed = adapter.remove_config("myconf")
    assert not removed
Ejemplo n.º 2
0
def test_store_and_retrieve_simple_config():
    adapter = SQLiteAdapter(MEMORY_DBNAME)
    store_val = {"val1": True, "val2": None, "val3": 1.4}
    adapter.store_config("myconf", store_val)
    read_val = adapter.read_config("myconf")
    assert read_val == store_val
    assert read_val is not store_val
Ejemplo n.º 3
0
def test_load_missing_config_data():
    adapter = SQLiteAdapter(MEMORY_DBNAME)
    assert adapter.read_config("foo") is None