def test_find_record(mongo_client):
generic_dao = GenericDAO(mongo_client, "testdb")
r = generic_dao.find_record("runs", {"_id": "NON_EXISTING_ID"})
assert r is None
r = generic_dao.find_record("runs",
{"_id": bson.ObjectId(
"58163443b1758523257c69ca")})
assert r is not None
assert r["config"] is not None
assert r["config"]["seed"] == 185616783
r = generic_dao.find_record("runs", {"config.learning_rate": 0.0001})
assert r is not None
assert r["config"] is not None
assert r["config"]["seed"] == 144363069
评论列表
文章目录