Skip to content

Commit 14e110f

Browse files
authored
Fix json decode error (http > https) (#49)
* http > https * fix for more/different results for new https url
1 parent 095c9c1 commit 14e110f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

sgs/api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_data(ts_code: int, begin: str, end: str) -> List:
1616
"""
1717

1818
url = (
19-
"http://api.bcb.gov.br/dados/serie/bcdata.sgs.{}"
19+
"https://api.bcb.gov.br/dados/serie/bcdata.sgs.{}"
2020
"/dados?formato=json&dataInicial={}&dataFinal={}"
2121
)
2222
request_url = url.format(ts_code, begin, end)

tests/test_search.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_search_by_text_query_returns_multiple_result_pages():
100100
def test_search_by_text_multiple_results():
101101
results = search_ts("dolar", "pt")
102102
assert isinstance(results, list)
103-
result_count = 41
103+
result_count = 43
104104
assert len(results) == result_count
105105
assert results[0]["code"] == 1
106-
assert results[-1]["code"] == 21636
106+
assert results[-1]["code"] == 29372

0 commit comments

Comments
 (0)