def test_run(create_server): server: Server = create_server() db = server.conn prj, uid = "p18", "3i920" run_as_dict = RunObject().to_dict() run_as_dict["metadata"].update({"algorithm": "svm", "C": 3}) db.store_run(run_as_dict, uid, prj) data = db.read_run(uid, prj) assert data == run_as_dict, "read_run" new_c = 4 updates = {"metadata.C": new_c} db.update_run(updates, uid, prj) data = db.read_run(uid, prj) assert data["metadata"]["C"] == new_c, "update_run" db.del_run(uid, prj)
def test_run(create_server): server: Server = create_server() db = server.conn prj, uid = 'p18', '3i920' run_as_dict = RunObject().to_dict() run_as_dict['metadata'].update({'algorithm': 'svm', 'C': 3}) db.store_run(run_as_dict, uid, prj) data = db.read_run(uid, prj) assert data == run_as_dict, 'read_run' new_c = 4 updates = {'metadata.C': new_c} db.update_run(updates, uid, prj) data = db.read_run(uid, prj) assert data['metadata']['C'] == new_c, 'update_run' db.del_run(uid, prj)
def test_runs(create_server): server: Server = create_server() db = server.conn runs = db.list_runs() assert not runs, 'found runs in new db' count = 7 prj = 'p180' run_as_dict = RunObject().to_dict() for i in range(count): uid = f'uid_{i}' db.store_run(run_as_dict, uid, prj) runs = db.list_runs(project=prj) assert len(runs) == count, 'bad number of runs' db.del_runs(project=prj, state='created') runs = db.list_runs(project=prj) assert not runs, 'found runs in after delete'
def test_runs(create_server): server: Server = create_server() db = server.conn runs = db.list_runs() assert not runs, "found runs in new db" count = 7 prj = "p180" run_as_dict = RunObject().to_dict() for i in range(count): uid = f"uid_{i}" db.store_run(run_as_dict, uid, prj) runs = db.list_runs(project=prj) assert len(runs) == count, "bad number of runs" db.del_runs(project=prj, state="created") runs = db.list_runs(project=prj) assert not runs, "found runs in after delete"