From 55146190a667611842bd7063978bef1f97be6865 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 26 May 2020 13:29:22 -0700 Subject: [PATCH] Move tests into directories --- fedireads/tests/connectors/__init__.py | 1 + .../test_abstract_connector.py} | 0 .../test_fedireads_connector.py} | 6 +++--- .../test_openlibrary_connector.py} | 8 ++++---- .../test_self_connector.py} | 0 fedireads/tests/models/__init__.py | 1 + fedireads/tests/{ => models}/test_base_model.py | 0 fedireads/tests/{ => models}/test_book_model.py | 0 fedireads/tests/{ => models}/test_import_model.py | 0 fedireads/tests/{ => models}/test_status_model.py | 0 fedireads/tests/{ => models}/test_user_model.py | 0 fedireads/tests/status/__init__.py | 1 + fedireads/tests/{ => status}/test_comment.py | 0 fedireads/tests/{ => status}/test_quotation.py | 0 fedireads/tests/{ => status}/test_review.py | 0 fedireads/tests/{ => status}/test_status.py | 0 16 files changed, 10 insertions(+), 7 deletions(-) create mode 100644 fedireads/tests/connectors/__init__.py rename fedireads/tests/{test_connector_abstract.py => connectors/test_abstract_connector.py} (100%) rename fedireads/tests/{test_connector_fedireads.py => connectors/test_fedireads_connector.py} (93%) rename fedireads/tests/{test_connector_openlibrary.py => connectors/test_openlibrary_connector.py} (93%) rename fedireads/tests/{test_connector_self.py => connectors/test_self_connector.py} (100%) create mode 100644 fedireads/tests/models/__init__.py rename fedireads/tests/{ => models}/test_base_model.py (100%) rename fedireads/tests/{ => models}/test_book_model.py (100%) rename fedireads/tests/{ => models}/test_import_model.py (100%) rename fedireads/tests/{ => models}/test_status_model.py (100%) rename fedireads/tests/{ => models}/test_user_model.py (100%) create mode 100644 fedireads/tests/status/__init__.py rename fedireads/tests/{ => status}/test_comment.py (100%) rename fedireads/tests/{ => status}/test_quotation.py (100%) rename fedireads/tests/{ => status}/test_review.py (100%) rename fedireads/tests/{ => status}/test_status.py (100%) diff --git a/fedireads/tests/connectors/__init__.py b/fedireads/tests/connectors/__init__.py new file mode 100644 index 00000000..b6e690fd --- /dev/null +++ b/fedireads/tests/connectors/__init__.py @@ -0,0 +1 @@ +from . import * diff --git a/fedireads/tests/test_connector_abstract.py b/fedireads/tests/connectors/test_abstract_connector.py similarity index 100% rename from fedireads/tests/test_connector_abstract.py rename to fedireads/tests/connectors/test_abstract_connector.py diff --git a/fedireads/tests/test_connector_fedireads.py b/fedireads/tests/connectors/test_fedireads_connector.py similarity index 93% rename from fedireads/tests/test_connector_fedireads.py rename to fedireads/tests/connectors/test_fedireads_connector.py index ea5dd3e1..10dbd30b 100644 --- a/fedireads/tests/test_connector_fedireads.py +++ b/fedireads/tests/connectors/test_fedireads_connector.py @@ -22,9 +22,9 @@ class FedireadsConnector(TestCase): self.connector = Connector('example.com') work_file = pathlib.Path(__file__).parent.joinpath( - 'data/fr_work.json') + '../data/fr_work.json') edition_file = pathlib.Path(__file__).parent.joinpath( - 'data/fr_edition.json') + '../data/fr_edition.json') self.work_data = json.loads(work_file.read_bytes()) self.edition_data = json.loads(edition_file.read_bytes()) @@ -45,7 +45,7 @@ class FedireadsConnector(TestCase): def test_format_search_result(self): - datafile = pathlib.Path(__file__).parent.joinpath('data/fr_search.json') + datafile = pathlib.Path(__file__).parent.joinpath('../data/fr_search.json') search_data = json.loads(datafile.read_bytes()) results = self.connector.parse_search_data(search_data) self.assertIsInstance(results, list) diff --git a/fedireads/tests/test_connector_openlibrary.py b/fedireads/tests/connectors/test_openlibrary_connector.py similarity index 93% rename from fedireads/tests/test_connector_openlibrary.py rename to fedireads/tests/connectors/test_openlibrary_connector.py index a17f4698..8d8cc19d 100644 --- a/fedireads/tests/test_connector_openlibrary.py +++ b/fedireads/tests/connectors/test_openlibrary_connector.py @@ -26,11 +26,11 @@ class Openlibrary(TestCase): self.connector = Connector('openlibrary.org') work_file = pathlib.Path(__file__).parent.joinpath( - 'data/ol_work.json') + '../data/ol_work.json') edition_file = pathlib.Path(__file__).parent.joinpath( - 'data/ol_edition.json') + '../data/ol_edition.json') edition_list_file = pathlib.Path(__file__).parent.joinpath( - 'data/ol_edition_list.json') + '../data/ol_edition_list.json') self.work_data = json.loads(work_file.read_bytes()) self.edition_data = json.loads(edition_file.read_bytes()) self.edition_list_data = json.loads(edition_list_file.read_bytes()) @@ -48,7 +48,7 @@ class Openlibrary(TestCase): def test_format_search_result(self): ''' translate json from openlibrary into SearchResult ''' - datafile = pathlib.Path(__file__).parent.joinpath('data/ol_search.json') + datafile = pathlib.Path(__file__).parent.joinpath('../data/ol_search.json') search_data = json.loads(datafile.read_bytes()) results = self.connector.parse_search_data(search_data) self.assertIsInstance(results, list) diff --git a/fedireads/tests/test_connector_self.py b/fedireads/tests/connectors/test_self_connector.py similarity index 100% rename from fedireads/tests/test_connector_self.py rename to fedireads/tests/connectors/test_self_connector.py diff --git a/fedireads/tests/models/__init__.py b/fedireads/tests/models/__init__.py new file mode 100644 index 00000000..b6e690fd --- /dev/null +++ b/fedireads/tests/models/__init__.py @@ -0,0 +1 @@ +from . import * diff --git a/fedireads/tests/test_base_model.py b/fedireads/tests/models/test_base_model.py similarity index 100% rename from fedireads/tests/test_base_model.py rename to fedireads/tests/models/test_base_model.py diff --git a/fedireads/tests/test_book_model.py b/fedireads/tests/models/test_book_model.py similarity index 100% rename from fedireads/tests/test_book_model.py rename to fedireads/tests/models/test_book_model.py diff --git a/fedireads/tests/test_import_model.py b/fedireads/tests/models/test_import_model.py similarity index 100% rename from fedireads/tests/test_import_model.py rename to fedireads/tests/models/test_import_model.py diff --git a/fedireads/tests/test_status_model.py b/fedireads/tests/models/test_status_model.py similarity index 100% rename from fedireads/tests/test_status_model.py rename to fedireads/tests/models/test_status_model.py diff --git a/fedireads/tests/test_user_model.py b/fedireads/tests/models/test_user_model.py similarity index 100% rename from fedireads/tests/test_user_model.py rename to fedireads/tests/models/test_user_model.py diff --git a/fedireads/tests/status/__init__.py b/fedireads/tests/status/__init__.py new file mode 100644 index 00000000..b6e690fd --- /dev/null +++ b/fedireads/tests/status/__init__.py @@ -0,0 +1 @@ +from . import * diff --git a/fedireads/tests/test_comment.py b/fedireads/tests/status/test_comment.py similarity index 100% rename from fedireads/tests/test_comment.py rename to fedireads/tests/status/test_comment.py diff --git a/fedireads/tests/test_quotation.py b/fedireads/tests/status/test_quotation.py similarity index 100% rename from fedireads/tests/test_quotation.py rename to fedireads/tests/status/test_quotation.py diff --git a/fedireads/tests/test_review.py b/fedireads/tests/status/test_review.py similarity index 100% rename from fedireads/tests/test_review.py rename to fedireads/tests/status/test_review.py diff --git a/fedireads/tests/test_status.py b/fedireads/tests/status/test_status.py similarity index 100% rename from fedireads/tests/test_status.py rename to fedireads/tests/status/test_status.py