예제 #1
0
def test_document_schema_dump_one_dict_many_false(
        document_schema: DocumentSchema, deserialized_document: Document,
        serialized_document: dict):
    assert document_schema.dump(deserialized_document) == serialized_document
예제 #2
0
def test_document_schema_dump_list_no_empty_many_true(
        document_schema: DocumentSchema, deserialized_document: Document):
    assert len(document_schema.dump([deserialized_document], many=True)) == 1
예제 #3
0
def test_document_schema_dump_list_of_dicts_many_true(
        document_schema: DocumentSchema, deserialized_document: Document):
    assert type(document_schema.dump([deserialized_document],
                                     many=True)[0]) is dict
예제 #4
0
def test_document_schema_dump_one_dict_many_true(
        document_schema: DocumentSchema, deserialized_document: Document,
        serialized_document: dict):
    assert document_schema.dump([deserialized_document],
                                many=True) == [serialized_document]