mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-25 11:01:12 +00:00
Move tests into directories
This commit is contained in:
parent
6b551709cc
commit
55146190a6
16 changed files with 10 additions and 7 deletions
1
fedireads/tests/connectors/__init__.py
Normal file
1
fedireads/tests/connectors/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import *
|
|
@ -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)
|
|
@ -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)
|
1
fedireads/tests/models/__init__.py
Normal file
1
fedireads/tests/models/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import *
|
1
fedireads/tests/status/__init__.py
Normal file
1
fedireads/tests/status/__init__.py
Normal file
|
@ -0,0 +1 @@
|
|||
from . import *
|
Loading…
Reference in a new issue