def test_annotation_schema_dump_none_datetime_as_null( annotation_schema: AnnotationSchema, deserialized_annotation: Annotation): deserialized_annotation.timestamp = None assert annotation_schema.dump(deserialized_annotation)['timestamp'] is None
def test_annotation_schema_dump_one_dict_many_false( annotation_schema: AnnotationSchema, deserialized_annotation: Annotation, serialized_annotation: dict): assert annotation_schema.dump( deserialized_annotation) == serialized_annotation
def test_annotation_schema_dump_list_no_empty_many_true( annotation_schema: AnnotationSchema, deserialized_annotation: Annotation): assert len(annotation_schema.dump([deserialized_annotation], many=True)) == 1
def test_annotation_schema_dump_list_of_dicts_many_true( annotation_schema: AnnotationSchema, deserialized_annotation: Annotation): assert type( annotation_schema.dump([deserialized_annotation], many=True)[0]) is dict
def test_annotation_schema_dump_one_dict_many_true( annotation_schema: AnnotationSchema, deserialized_annotation: Annotation, serialized_annotation: dict): assert annotation_schema.dump([deserialized_annotation], many=True) == [serialized_annotation]