From 745fe9e36bce3621f89a260f882f9f8373d215a4 Mon Sep 17 00:00:00 2001 From: amercader Date: Mon, 26 Aug 2024 15:26:31 +0200 Subject: [PATCH] Rearrange test modules We have a lot of them! Order things a bit so they are easier to navigate --- ckanext/dcat/tests/harvester/__init__.py | 0 ckanext/dcat/tests/{ => harvester}/test_harvester.py | 0 ckanext/dcat/tests/{ => harvester}/test_json_harvester.py | 0 ckanext/dcat/tests/{ => logic}/test_logic.py | 0 ckanext/dcat/tests/{ => logic}/test_validators.py | 0 ckanext/dcat/tests/profiles/__init__.py | 0 ckanext/dcat/tests/profiles/base/__init__.py | 0 ckanext/dcat/tests/{ => profiles/base}/test_base_parser.py | 0 ckanext/dcat/tests/{ => profiles/base}/test_base_profile.py | 2 +- .../dcat/tests/{ => profiles/base}/test_base_serializer.py | 0 ckanext/dcat/tests/profiles/dcat_ap/__init__.py | 0 .../dcat_ap}/test_euro_dcatap_profile_parse.py | 0 .../dcat_ap}/test_euro_dcatap_profile_serialize.py | 0 ckanext/dcat/tests/profiles/dcat_ap_2/__init__.py | 0 .../dcat_ap_2}/test_euro_dcatap_2_profile_parse.py | 0 .../dcat_ap_2}/test_euro_dcatap_2_profile_serialize.py | 0 .../tests/{ => profiles/dcat_ap_2}/test_scheming_support.py | 0 ckanext/dcat/tests/profiles/dcat_ap_3/__init__.py | 0 ckanext/dcat/tests/profiles/schemaorg/__init__.py | 0 .../schemaorg}/test_schemaorg_profile_serialize.py | 2 +- ckanext/dcat/tests/{ => shacl}/test_shacl.py | 2 +- setup.py | 6 +++--- 22 files changed, 6 insertions(+), 6 deletions(-) create mode 100644 ckanext/dcat/tests/harvester/__init__.py rename ckanext/dcat/tests/{ => harvester}/test_harvester.py (100%) rename ckanext/dcat/tests/{ => harvester}/test_json_harvester.py (100%) rename ckanext/dcat/tests/{ => logic}/test_logic.py (100%) rename ckanext/dcat/tests/{ => logic}/test_validators.py (100%) create mode 100644 ckanext/dcat/tests/profiles/__init__.py create mode 100644 ckanext/dcat/tests/profiles/base/__init__.py rename ckanext/dcat/tests/{ => profiles/base}/test_base_parser.py (100%) rename ckanext/dcat/tests/{ => profiles/base}/test_base_profile.py (99%) rename ckanext/dcat/tests/{ => profiles/base}/test_base_serializer.py (100%) create mode 100644 ckanext/dcat/tests/profiles/dcat_ap/__init__.py rename ckanext/dcat/tests/{ => profiles/dcat_ap}/test_euro_dcatap_profile_parse.py (100%) rename ckanext/dcat/tests/{ => profiles/dcat_ap}/test_euro_dcatap_profile_serialize.py (100%) create mode 100644 ckanext/dcat/tests/profiles/dcat_ap_2/__init__.py rename ckanext/dcat/tests/{ => profiles/dcat_ap_2}/test_euro_dcatap_2_profile_parse.py (100%) rename ckanext/dcat/tests/{ => profiles/dcat_ap_2}/test_euro_dcatap_2_profile_serialize.py (100%) rename ckanext/dcat/tests/{ => profiles/dcat_ap_2}/test_scheming_support.py (100%) create mode 100644 ckanext/dcat/tests/profiles/dcat_ap_3/__init__.py create mode 100644 ckanext/dcat/tests/profiles/schemaorg/__init__.py rename ckanext/dcat/tests/{ => profiles/schemaorg}/test_schemaorg_profile_serialize.py (99%) rename ckanext/dcat/tests/{ => shacl}/test_shacl.py (98%) diff --git a/ckanext/dcat/tests/harvester/__init__.py b/ckanext/dcat/tests/harvester/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/test_harvester.py b/ckanext/dcat/tests/harvester/test_harvester.py similarity index 100% rename from ckanext/dcat/tests/test_harvester.py rename to ckanext/dcat/tests/harvester/test_harvester.py diff --git a/ckanext/dcat/tests/test_json_harvester.py b/ckanext/dcat/tests/harvester/test_json_harvester.py similarity index 100% rename from ckanext/dcat/tests/test_json_harvester.py rename to ckanext/dcat/tests/harvester/test_json_harvester.py diff --git a/ckanext/dcat/tests/test_logic.py b/ckanext/dcat/tests/logic/test_logic.py similarity index 100% rename from ckanext/dcat/tests/test_logic.py rename to ckanext/dcat/tests/logic/test_logic.py diff --git a/ckanext/dcat/tests/test_validators.py b/ckanext/dcat/tests/logic/test_validators.py similarity index 100% rename from ckanext/dcat/tests/test_validators.py rename to ckanext/dcat/tests/logic/test_validators.py diff --git a/ckanext/dcat/tests/profiles/__init__.py b/ckanext/dcat/tests/profiles/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/profiles/base/__init__.py b/ckanext/dcat/tests/profiles/base/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/test_base_parser.py b/ckanext/dcat/tests/profiles/base/test_base_parser.py similarity index 100% rename from ckanext/dcat/tests/test_base_parser.py rename to ckanext/dcat/tests/profiles/base/test_base_parser.py diff --git a/ckanext/dcat/tests/test_base_profile.py b/ckanext/dcat/tests/profiles/base/test_base_profile.py similarity index 99% rename from ckanext/dcat/tests/test_base_profile.py rename to ckanext/dcat/tests/profiles/base/test_base_profile.py index b34872b8..235b001f 100644 --- a/ckanext/dcat/tests/test_base_profile.py +++ b/ckanext/dcat/tests/profiles/base/test_base_profile.py @@ -8,7 +8,7 @@ from ckanext.dcat.profiles import RDFProfile, CleanedURIRef -from ckanext.dcat.tests.test_base_parser import _default_graph +from ckanext.dcat.tests.profiles.base.test_base_parser import _default_graph DCT = Namespace("http://purl.org/dc/terms/") diff --git a/ckanext/dcat/tests/test_base_serializer.py b/ckanext/dcat/tests/profiles/base/test_base_serializer.py similarity index 100% rename from ckanext/dcat/tests/test_base_serializer.py rename to ckanext/dcat/tests/profiles/base/test_base_serializer.py diff --git a/ckanext/dcat/tests/profiles/dcat_ap/__init__.py b/ckanext/dcat/tests/profiles/dcat_ap/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/test_euro_dcatap_profile_parse.py b/ckanext/dcat/tests/profiles/dcat_ap/test_euro_dcatap_profile_parse.py similarity index 100% rename from ckanext/dcat/tests/test_euro_dcatap_profile_parse.py rename to ckanext/dcat/tests/profiles/dcat_ap/test_euro_dcatap_profile_parse.py diff --git a/ckanext/dcat/tests/test_euro_dcatap_profile_serialize.py b/ckanext/dcat/tests/profiles/dcat_ap/test_euro_dcatap_profile_serialize.py similarity index 100% rename from ckanext/dcat/tests/test_euro_dcatap_profile_serialize.py rename to ckanext/dcat/tests/profiles/dcat_ap/test_euro_dcatap_profile_serialize.py diff --git a/ckanext/dcat/tests/profiles/dcat_ap_2/__init__.py b/ckanext/dcat/tests/profiles/dcat_ap_2/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/test_euro_dcatap_2_profile_parse.py b/ckanext/dcat/tests/profiles/dcat_ap_2/test_euro_dcatap_2_profile_parse.py similarity index 100% rename from ckanext/dcat/tests/test_euro_dcatap_2_profile_parse.py rename to ckanext/dcat/tests/profiles/dcat_ap_2/test_euro_dcatap_2_profile_parse.py diff --git a/ckanext/dcat/tests/test_euro_dcatap_2_profile_serialize.py b/ckanext/dcat/tests/profiles/dcat_ap_2/test_euro_dcatap_2_profile_serialize.py similarity index 100% rename from ckanext/dcat/tests/test_euro_dcatap_2_profile_serialize.py rename to ckanext/dcat/tests/profiles/dcat_ap_2/test_euro_dcatap_2_profile_serialize.py diff --git a/ckanext/dcat/tests/test_scheming_support.py b/ckanext/dcat/tests/profiles/dcat_ap_2/test_scheming_support.py similarity index 100% rename from ckanext/dcat/tests/test_scheming_support.py rename to ckanext/dcat/tests/profiles/dcat_ap_2/test_scheming_support.py diff --git a/ckanext/dcat/tests/profiles/dcat_ap_3/__init__.py b/ckanext/dcat/tests/profiles/dcat_ap_3/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/profiles/schemaorg/__init__.py b/ckanext/dcat/tests/profiles/schemaorg/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/ckanext/dcat/tests/test_schemaorg_profile_serialize.py b/ckanext/dcat/tests/profiles/schemaorg/test_schemaorg_profile_serialize.py similarity index 99% rename from ckanext/dcat/tests/test_schemaorg_profile_serialize.py rename to ckanext/dcat/tests/profiles/schemaorg/test_schemaorg_profile_serialize.py index 2c671fa6..0d1949d5 100644 --- a/ckanext/dcat/tests/test_schemaorg_profile_serialize.py +++ b/ckanext/dcat/tests/profiles/schemaorg/test_schemaorg_profile_serialize.py @@ -15,7 +15,7 @@ from ckanext.dcat.processors import RDFSerializer from ckanext.dcat.profiles import SCHEMA -from ckanext.dcat.tests.test_euro_dcatap_profile_serialize import BaseSerializeTest +from ckanext.dcat.tests.profiles.dcat_ap.test_euro_dcatap_profile_serialize import BaseSerializeTest class TestSchemaOrgProfileSerializeDataset(BaseSerializeTest): diff --git a/ckanext/dcat/tests/test_shacl.py b/ckanext/dcat/tests/shacl/test_shacl.py similarity index 98% rename from ckanext/dcat/tests/test_shacl.py rename to ckanext/dcat/tests/shacl/test_shacl.py index ac293b37..cd8a0b69 100644 --- a/ckanext/dcat/tests/test_shacl.py +++ b/ckanext/dcat/tests/shacl/test_shacl.py @@ -12,7 +12,7 @@ def _get_shacl_file_path(file_name): - return os.path.join(os.path.dirname(__file__), "shacl", file_name) + return os.path.join(os.path.dirname(__file__), file_name) generated_graphs = {} diff --git a/setup.py b/setup.py index 78fb19fa..62e5c1fd 100644 --- a/setup.py +++ b/setup.py @@ -36,9 +36,9 @@ structured_data=ckanext.dcat.plugins:StructuredDataPlugin # Test plugins - test_rdf_harvester=ckanext.dcat.tests.test_harvester:TestRDFHarvester - test_rdf_null_harvester=ckanext.dcat.tests.test_harvester:TestRDFNullHarvester - test_rdf_exception_harvester=ckanext.dcat.tests.test_harvester:TestRDFExceptionHarvester + test_rdf_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFHarvester + test_rdf_null_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFNullHarvester + test_rdf_exception_harvester=ckanext.dcat.tests.harvester.test_harvester:TestRDFExceptionHarvester [ckan.rdf.profiles] euro_dcat_ap=ckanext.dcat.profiles:EuropeanDCATAPProfile