예제 #1
0
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
예제 #2
0
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
예제 #3
0
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
예제 #4
0
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
예제 #5
0
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]