mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-18 06:06:34 +00:00
Adds inventaire get connector test
This commit is contained in:
parent
d0114d2e83
commit
41742d6698
1 changed files with 12 additions and 0 deletions
|
@ -171,3 +171,15 @@ class Inventaire(TestCase):
|
|||
}
|
||||
self.assertEqual(get_language_code(options), "there")
|
||||
self.assertIsNone(get_language_code({}))
|
||||
|
||||
@responses.activate
|
||||
def test_get_description(self):
|
||||
"""extract a wikipedia excerpt"""
|
||||
responses.add(
|
||||
responses.GET,
|
||||
"https://inventaire.io/api/data?action=wp-extract&lang=en&title=test_path",
|
||||
json={"extract": "hi hi"},
|
||||
)
|
||||
|
||||
extract = self.connector.get_description({"enwiki": "test_path"})
|
||||
self.assertEqual(extract, "hi hi")
|
||||
|
|
Loading…
Reference in a new issue