Skip to content

Commit

Permalink
fix refs, tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tomkralidis committed Jan 24, 2025
1 parent 1764cac commit 7460131
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyoscar/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ def get_station_report(self, identifier: str, summary=False,
if any(s in response.text for s in ['error', 'deleted']):
# noqa WSI not found via OAPI route, note this only works for primary WSI
# Try REST API, note this is much slower
LOGGER.warning(f"Falling back to REST API for {identifier}")
request = f"{self.api_url}/wmd/download/{identifier}" # noqa
LOGGER.warning(f'Falling back to {self.api_url} for {identifier}')
request = f'{self.api_url}/wmd/download/{identifier}'
response = requests.get(request, headers=self.headers)
if response.status_code == 404:
return {}
Expand Down
2 changes: 2 additions & 0 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ def test_get_station_report(self, mock_get):

fake_responses = [mock.Mock(), mock.Mock()]
fake_responses[0].json.return_value = sel0
fake_responses[0].text = str(sel0)
fake_responses[1].json.return_value = sel1
fake_responses[1].text = str(sel1)

mock_get.side_effect = fake_responses

Expand Down

0 comments on commit 7460131

Please sign in to comment.