def create(raw_data: NormalizedData) -> BaseData:
    raw_data_doc = raw_data.to_doc()
    mongo_crud_wrapper.create(COLLECTION_NAME, raw_data_doc)
    return NormalizedData.from_doc(raw_data_doc)
def update(raw_data: NormalizedData) -> UpdateResult:
    raw_data_doc = raw_data.to_doc()
    return mongo_crud_wrapper.update(COLLECTION_NAME, raw_data_doc)
예제 #3
0
def test_get_doc(normalized_data: NormalizedData, object_id):
    normalized_data.uid = object_id
    normalized_data_doc = normalized_data.to_doc()
    data_obj = NormalizedData.from_doc(normalized_data_doc)
    assert data_obj == normalized_data