Exemplo n.º 1
0
def test_db_update(output_dir):
    db = DbManager(os.path.join(output_dir, "temp_testing.db"))
    assert db is not None
    db.build()

    v = {
        "measure_id": "test.measure",
        "instrument_name": "test",
        "measure_name": "measure",
        "measure_type": "other",
        "description": "desc",
    }
    print(v)
    db.save(v)
    print(v)
    v["measure_id"] = "test.measure"
    v["figure_distribution"] = "test_figure.png"
    db.save(v)

    r = db.get("test.measure")
    assert r is not None
    assert r.measure_id == "test.measure"
    assert r.instrument_name == "test"
    assert r.measure_name == "measure"
    assert r.figure_distribution == "test_figure.png"
Exemplo n.º 2
0
def test_db_save(output_dir):
    db = DbManager(os.path.join(output_dir, "temp_testing.db"))
    assert db is not None

    print(db.dbfile)
    db.build()

    v = {
        "measure_id": "test.measure",
        "instrument_name": "test",
        "measure_name": "measure",
        "measure_type": "other",
        "description": "desc",
    }

    db.save(v)

    r = db.get("test.measure")
    assert r is not None
    assert r.measure_id == "test.measure"
    assert r.instrument_name == "test"
    assert r.measure_name == "measure"
    assert r.figure_distribution is None