1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Create repairs issue if an outdated currency code is configured (#81717)

* Create repairs issue if an outdated currency code is configured

* Add script for updating list of currencies

* Use black for formatting

* Move currency codes to a separate file

* Address review comments
This commit is contained in:
Erik Montnemery
2022-11-08 07:21:09 +01:00
committed by GitHub
parent 0ce301ae7b
commit c3d4a9cd99
8 changed files with 418 additions and 168 deletions

View File

@@ -1332,3 +1332,15 @@ def test_currency():
for value in ("EUR", "USD"):
assert schema(value)
def test_historic_currency():
"""Test historic currency validator."""
schema = vol.Schema(cv.historic_currency)
for value in (None, "BTC", "EUR"):
with pytest.raises(vol.MultipleInvalid):
schema(value)
for value in ("DEM", "NLG"):
assert schema(value)