def test_get_rates(): with pytest.raises(ValueError): cc = CurrencyConverter("USD", "PKSD").get_rates() with pytest.raises(ValueError): cc = CurrencyConverter("MKTS", "USD").get_rates() with pytest.raises(AttributeError): cc = CurrencyConverter().get_rates() with pytest.raises(ValueError): cc = CurrencyConverter(map_currency=True) cc.from_currency("USD").to_currency(["GBP", "JPY"]).get_rates() cc = CurrencyConverter("USD", "JPY") assert isinstance(cc.get_rates(), dict) assert isinstance(cc.get_rates(True), str)
def test_from_currency(): cc = CurrencyConverter() assert cc.from_currency(["USD", "GBP"]).from_ == ["USD", "GBP"]