mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-10-27 04:31:13 +00:00
fix(famafrench): Australia's country portfolio file is Austrlia.Dat (#7758)
The members of F-F_International_Countries.zip (and its _Wout_Div twin) use eight-character names, and Australia's is Austrlia.Dat, not Australia.Dat. Every Australia request failed with "not found in available indexes". The other twenty countries already map to their member names. Co-authored-by: artcashin <artinnj@gmail.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: dlee-bq <dlee@brightquery.com> Co-authored-by: Danglewood <85772166+deeleeramone@users.noreply.github.com>
This commit is contained in:
@@ -1004,7 +1004,7 @@ COUNTRY_PORTFOLIOS_URLS = {
|
|||||||
|
|
||||||
COUNTRY_PORTFOLIO_FILES = {
|
COUNTRY_PORTFOLIO_FILES = {
|
||||||
"Austria": "Austria.Dat",
|
"Austria": "Austria.Dat",
|
||||||
"Australia": "Australia.Dat",
|
"Australia": "Austrlia.Dat",
|
||||||
"Belgium": "Belgium.Dat",
|
"Belgium": "Belgium.Dat",
|
||||||
"Canada": "Canada.Dat",
|
"Canada": "Canada.Dat",
|
||||||
"Denmark": "Denmark.Dat",
|
"Denmark": "Denmark.Dat",
|
||||||
|
|||||||
@@ -568,6 +568,55 @@ def test_get_international_portfolio_data_index_missing_in_zip(monkeypatch):
|
|||||||
helpers.get_international_portfolio_data(index="all")
|
helpers.get_international_portfolio_data(index="all")
|
||||||
|
|
||||||
|
|
||||||
|
# The members of F-F_International_Countries.zip and its _Wout_Div twin.
|
||||||
|
_COUNTRY_ZIP_MEMBERS = {
|
||||||
|
"Austria.Dat",
|
||||||
|
"Austrlia.Dat",
|
||||||
|
"Belgium.Dat",
|
||||||
|
"Canada.Dat",
|
||||||
|
"Denmark.Dat",
|
||||||
|
"Finland.Dat",
|
||||||
|
"France.Dat",
|
||||||
|
"Germany.Dat",
|
||||||
|
"HongKong.Dat",
|
||||||
|
"Ireland.Dat",
|
||||||
|
"Italy.Dat",
|
||||||
|
"Japan.Dat",
|
||||||
|
"Malaysia.Dat",
|
||||||
|
"Nethrlnd.Dat",
|
||||||
|
"NewZland.Dat",
|
||||||
|
"Norway.Dat",
|
||||||
|
"Singapor.Dat",
|
||||||
|
"Spain.Dat",
|
||||||
|
"Sweden.Dat",
|
||||||
|
"Swtzrlnd.Dat",
|
||||||
|
"UK.Dat",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
def test_every_country_maps_to_a_zip_member():
|
||||||
|
"""Each country names a member of the archive; Australia's is Austrlia.Dat."""
|
||||||
|
missing = {
|
||||||
|
country: member
|
||||||
|
for country, member in helpers.COUNTRY_PORTFOLIO_FILES.items()
|
||||||
|
if member not in _COUNTRY_ZIP_MEMBERS
|
||||||
|
}
|
||||||
|
assert missing == {}
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_international_portfolio_data_australia(monkeypatch):
|
||||||
|
"""Australia reads the archive's eight-character member name."""
|
||||||
|
monkeypatch.setattr(
|
||||||
|
helpers,
|
||||||
|
"download_international_portfolios",
|
||||||
|
lambda url: _IntlResponse(_make_zip("Austrlia.Dat", b"australia data")),
|
||||||
|
)
|
||||||
|
|
||||||
|
result = helpers.get_international_portfolio_data(country="australia")
|
||||||
|
|
||||||
|
assert result == "australia data"
|
||||||
|
|
||||||
|
|
||||||
def test_get_international_portfolio_data_unresolved_country_index(monkeypatch):
|
def test_get_international_portfolio_data_unresolved_country_index(monkeypatch):
|
||||||
monkeypatch.setitem(helpers.COUNTRY_PORTFOLIO_FILES, "Japan", None)
|
monkeypatch.setitem(helpers.COUNTRY_PORTFOLIO_FILES, "Japan", None)
|
||||||
monkeypatch.setattr(
|
monkeypatch.setattr(
|
||||||
|
|||||||
Reference in New Issue
Block a user