Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock pubmed API call in test #557

Closed
proccaserra opened this issue Mar 25, 2024 · 0 comments · Fixed by #567
Closed

mock pubmed API call in test #557

proccaserra opened this issue Mar 25, 2024 · 0 comments · Fixed by #567

Comments

@proccaserra
Copy link
Member

to avoid build failure as witnessed:

ERROR: test_get_pubmed_article (utils.test_isatools_utils.TestPubMedIDUtil)

Traceback (most recent call last):
File "/home/runner/work/isa-api/isa-api/tests/utils/test_isatools_utils.py", line 172, in test_get_pubmed_article
J = pubmed.get_pubmed_article('25520553')
File "/home/runner/work/isa-api/isa-api/isatools/net/pubmed.py", line 23, in get_pubmed_article
handle = Entrez.efetch(db="pubmed", id=pubmed_id.strip(), rettype="medline", retmode="text")
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/Bio/Entrez/init.py", line 197, in efetch
return _open(request)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/site-packages/Bio/Entrez/init.py", line 623, in _open
handle = urlopen(request)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 216, in urlopen
return opener.open(url, data, timeout)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 525, in open
response = meth(req, response)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 634, in http_response
response = self.parent.error(
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 563, in error
return self._call_chain(*args)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 496, in _call_chain
result = func(*args)
File "/opt/hostedtoolcache/Python/3.10.13/x64/lib/python3.10/urllib/request.py", line 643, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 502: Bad Gateway

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants