Skip to content

Commit

Permalink
Mark matchdoc as broken
Browse files Browse the repository at this point in the history
Always get a 404 back from ADS
  • Loading branch information
rjfarmer committed Aug 16, 2022
1 parent 95ff35d commit ed0684c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 183 deletions.
10 changes: 7 additions & 3 deletions src/pyastroapi/api/recommender.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from . import urls
from . import http

import typing as t

__all__ = ["matchdoc", "similar", "trending", "reviews", "useful"]


Expand All @@ -13,8 +15,8 @@ def matchdoc(
author: str = "",
year: int = "",
doctype: str = "article",
match_doctype=["article"],
must_match=False,
match_doctype: t.List[str] = ["article"],
must_match=True,
):
url = urls.make_url(urls.urls["oracle"]["match"])

Expand All @@ -27,7 +29,9 @@ def matchdoc(
data["match_doctype"] = match_doctype
data["mustmatch"] = must_match

r = http.post(token, url, data=data)
r = http.post(token, url, data=data, json=True)

print(r)

if r.status != 200:
raise e.AdsApiError(r.response["error"])
Expand Down
180 changes: 0 additions & 180 deletions tests/cassettes/TestAPIRecommend.test_matchdoc.yaml

This file was deleted.

1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,7 @@ def test_word_cloud(self):

@pytest.mark.vcr()
class TestAPIRecommend:
@pytest.mark.skip(reason="Broken")
def test_matchdoc(self):

r = recommend.matchdoc(
Expand Down

0 comments on commit ed0684c

Please sign in to comment.