Merge pull request #181 from mouse-reeve/test-dirs

Move tests into directories
This commit is contained in:
Mouse Reeve 2020-05-29 13:50:22 -07:00 committed by GitHub
commit 4d6ecafcf4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 10 additions and 7 deletions

View file

@ -0,0 +1 @@
from . import *

View file

@ -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)

View file

@ -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)

View file

@ -0,0 +1 @@
from . import *

View file

@ -0,0 +1 @@
from . import *