def test_create_avro_bin(): avro_api = AvroAPI() avro_api.append_image_ann(image_ann) avro_api.set_url("blah") avro_io = AvroIO() response = avro_api.get_response() avro_io.write(response, avro_bin) flag = AvroIO.is_valid_avro_doc_static(response, avro_io.get_schema()) assert flag
def test_append_annotation_task(): avro_api = AvroAPI() avro_api.append_image_ann(image_ann) avro_api.set_url("blah") avro_api.append_annotation_task(annotation_task_1) avro_io = AvroIO() response = avro_api.get_response() # print(json.dumps(response)) # avro_io.encode_to_file(response, avro_bin) flag = AvroIO.is_valid_avro_doc_static(response, avro_io.get_schema()) assert flag AvroIO.write_json(response, annotation_task_1["id"] + ".json", 2)