mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Python formatting
This commit is contained in:
parent
f4800307b4
commit
8d38d1c9d1
2 changed files with 5 additions and 4 deletions
|
@ -89,7 +89,7 @@ class Connector(AbstractConnector):
|
||||||
|
|
||||||
def parse_isbn_search_data(self, data):
|
def parse_isbn_search_data(self, data):
|
||||||
"""got some daaaata"""
|
"""got some daaaata"""
|
||||||
results = data.get('entities')
|
results = data.get("entities")
|
||||||
if not results:
|
if not results:
|
||||||
return []
|
return []
|
||||||
return list(results.values())
|
return list(results.values())
|
||||||
|
@ -104,7 +104,7 @@ class Connector(AbstractConnector):
|
||||||
key=self.get_remote_id(search_result.get("uri")),
|
key=self.get_remote_id(search_result.get("uri")),
|
||||||
view_link="{:s}{:s}".format(self.base_url, search_result.get("uri")),
|
view_link="{:s}{:s}".format(self.base_url, search_result.get("uri")),
|
||||||
cover=self.get_cover_url(search_result.get("image")),
|
cover=self.get_cover_url(search_result.get("image")),
|
||||||
connector=self
|
connector=self,
|
||||||
)
|
)
|
||||||
|
|
||||||
def is_work_data(self, data):
|
def is_work_data(self, data):
|
||||||
|
|
|
@ -138,7 +138,7 @@ class Inventaire(TestCase):
|
||||||
self.assertEqual(result, ["epistolary novel", "crime novel"])
|
self.assertEqual(result, ["epistolary novel", "crime novel"])
|
||||||
|
|
||||||
def test_isbn_search(self):
|
def test_isbn_search(self):
|
||||||
""" another search type """
|
"""another search type"""
|
||||||
search_file = pathlib.Path(__file__).parent.joinpath(
|
search_file = pathlib.Path(__file__).parent.joinpath(
|
||||||
"../data/inventaire_isbn_search.json"
|
"../data/inventaire_isbn_search.json"
|
||||||
)
|
)
|
||||||
|
@ -149,7 +149,8 @@ class Inventaire(TestCase):
|
||||||
|
|
||||||
self.assertEqual(formatted.title, "L'homme aux cercles bleus")
|
self.assertEqual(formatted.title, "L'homme aux cercles bleus")
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
formatted.key, "https://inventaire.io?action=by-uris&uris=isbn:9782290349229"
|
formatted.key,
|
||||||
|
"https://inventaire.io?action=by-uris&uris=isbn:9782290349229",
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
formatted.cover,
|
formatted.cover,
|
||||||
|
|
Loading…
Reference in a new issue