diff --git a/test/test_jsontoavro.py b/test/test_jsontoavro.py index 21ba866..c39d6e9 100644 --- a/test/test_jsontoavro.py +++ b/test/test_jsontoavro.py @@ -15,6 +15,9 @@ def test_convert_address_jsons_to_avro(self): cwd = getcwd() jsons_path = path.join(cwd, "test", "jsons", "address.jsons") avro_path = path.join(cwd, "test", "tmp", "address.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_jsons_to_avro(jsons_path, avro_path, "example.com") @@ -22,6 +25,9 @@ def test_convert_movie_jsons_to_avro(self): cwd = getcwd() jsons_path = path.join(cwd, "test", "jsons", "movie.jsons") avro_path = path.join(cwd, "test", "tmp", "movie.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_jsons_to_avro(jsons_path, avro_path, "example.com") @@ -29,6 +35,9 @@ def test_convert_person_jsons_to_avro(self): cwd = getcwd() jsons_path = path.join(cwd, "test", "jsons", "person.jsons") avro_path = path.join(cwd, "test", "tmp", "person.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_jsons_to_avro(jsons_path, avro_path, "example.com") @@ -36,6 +45,9 @@ def test_convert_employee_jsons_to_avro(self): cwd = getcwd() jsons_path = path.join(cwd, "test", "jsons", "employee.jsons") avro_path = path.join(cwd, "test", "tmp", "employee.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_jsons_to_avro(jsons_path, avro_path, "example.com") @@ -43,6 +55,9 @@ def test_convert_azurestorage_jsons_to_avro(self): cwd = getcwd() jsons_path = path.join(cwd, "test", "jsons", "azurestorage.jsons") avro_path = path.join(cwd, "test", "tmp", "azurestorage.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_jsons_to_avro(jsons_path, avro_path, "microsoft.azure.storage") diff --git a/test/test_prototoavro.py b/test/test_prototoavro.py index aba7538..c4f214d 100644 --- a/test/test_prototoavro.py +++ b/test/test_prototoavro.py @@ -15,6 +15,9 @@ def test_convert_proto_to_avro(self): cwd = getcwd() proto_path = path.join(cwd, "test", "gtfsrt", "gtfsrt.proto") avro_path = path.join(cwd, "test", "tmp", "gtfsrt.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_proto_to_avro(proto_path, avro_path) diff --git a/test/test_xsdtoavro.py b/test/test_xsdtoavro.py index af4a56f..aee3d86 100644 --- a/test/test_xsdtoavro.py +++ b/test/test_xsdtoavro.py @@ -15,5 +15,8 @@ def test_convert_address_jsons_to_avro(self): cwd = os.getcwd() xsd_path = os.path.join(cwd, "test", "xsd", "crmdata.xsd") avro_path = os.path.join(cwd, "test", "tmp", "crmdata.avsc") + dir = os.path.dirname(avro_path) + if not os.path.exists(dir): + os.makedirs(dir) convert_xsd_to_avro(xsd_path, avro_path)