Add explicit "fiat convert singleton" code

This commit is contained in:
Matthias
2024-05-20 13:58:15 +02:00
parent 95077f4752
commit 7a309d6927

View File

@@ -11,6 +11,14 @@ from freqtrade.rpc.fiat_convert import CryptoToFiatConverter
from tests.conftest import log_has, log_has_re from tests.conftest import log_has, log_has_re
def test_fiat_convert_is_singleton():
fiat_convert = CryptoToFiatConverter()
fiat_convert2 = CryptoToFiatConverter()
assert fiat_convert is fiat_convert2
assert id(fiat_convert) == id(fiat_convert2)
def test_fiat_convert_is_supported(): def test_fiat_convert_is_supported():
fiat_convert = CryptoToFiatConverter() fiat_convert = CryptoToFiatConverter()
assert fiat_convert._is_supported_fiat(fiat="USD") is True assert fiat_convert._is_supported_fiat(fiat="USD") is True