Skip to content

Commit

Permalink
Refactor test_api.py to remove unnecessary characters from file path
Browse files Browse the repository at this point in the history
  • Loading branch information
philsv committed Oct 21, 2024
1 parent a2c6e68 commit afbb1e5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@ def test_get_series_via_route(route, series, frequency, facet, mocker):
file_path = get_mock_data_path(
f"{route.replace('/', '-')}_{series}_{frequency}_{facet}.json"
)

file_path = (
file_path.replace("[", "")
.replace("]", "")
.replace("'", "")
.replace(" ", "")
.replace(",", "_")
.strip()
)

spy_get = mock_requests_get(mocker, file_path)

df = eia.get_series_via_route(route, series, frequency, facet)
Expand Down

0 comments on commit afbb1e5

Please sign in to comment.