Skip to content

Commit cfa0e82

Browse files
committed
Add new endpoint search_episode_titles.
1 parent ed69262 commit cfa0e82

File tree

6 files changed

+2632
-2314
lines changed

6 files changed

+2632
-2314
lines changed

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ lint: venv
3535

3636
publish-test: test
3737
${VENV_NAME}/bin/python -m pip install --upgrade twine
38-
${VENV_NAME}/bin/python -m twine upload --repository testpypi .tox/dist/*
38+
${VENV_NAME}/bin/python -m twine upload --repository testpypi dist/*
3939

4040
publish: test
4141
${VENV_NAME}/bin/python -m pip install --upgrade twine
42-
${VENV_NAME}/bin/python -m twine upload --repository pypi .tox/dist/*
42+
${VENV_NAME}/bin/python -m twine upload --repository pypi dist/*
4343

4444
clean:
4545
@rm -rf $(VENV_NAME) .coverage .coverage.* build/ dist/ htmlcov/ *.egg-info .tox

README.md

+2,606-2,311
Large diffs are not rendered by default.

examples/sample.py

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@
4141
# response = client.search(q='startup')
4242
# print(response.json())
4343

44+
# response = client.search_episode_titles(q='Jerusalem Demsas on The Dispossessed')
45+
# print(response.json())
46+
4447
# response = client.spellcheck(q='evergrand stok')
4548
# print(response.json())
4649

listennotes/podcast_api.py

+7
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ def typeahead(self, **kwargs):
3939
headers=self.request_headers,
4040
)
4141

42+
def search_episode_titles(self, **kwargs):
43+
return self.http_client.get(
44+
"%s/search_episode_titles" % self.api_base,
45+
params=kwargs,
46+
headers=self.request_headers,
47+
)
48+
4249
def spellcheck(self, **kwargs):
4350
return self.http_client.get(
4451
"%s/spellcheck" % self.api_base,

listennotes/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VERSION = "1.1.5"
1+
VERSION = "1.1.6"

tests/test_client.py

+13
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,19 @@ def test_search_with_authentication_error(self):
4040
else:
4141
assert False
4242

43+
def test_search_episode_titles_with_mock(self):
44+
client = podcast_api.Client()
45+
term = "dummy2"
46+
response = client.search_episode_titles(
47+
q=term, podcast_id='0cdaa63b905b4de3861554669a6a3dd1')
48+
assert len(response.json().get("results", [])) > 0
49+
assert response.request.method == "GET"
50+
url = urlparse(response.url)
51+
assert url.path == "/api/v2/search_episode_titles"
52+
params = parse_qs(url.query)
53+
assert params["q"][0] == term
54+
assert params["podcast_id"][0] == "0cdaa63b905b4de3861554669a6a3dd1"
55+
4356
def test_typeahead_with_mock(self):
4457
client = podcast_api.Client()
4558
term = "dummy"

0 commit comments

Comments
 (0)