def setUp(self):
     validUntilTime = time.time() + 2
     
     writeCurrenciesIntoCacheFile(["EUR", "GBP", "USD"], validUntil = validUntilTime)      
     rateToEUR = ExchangeRate("USD", "EUR", 2.50, validUntil = validUntilTime)
     rateToGBP = ExchangeRate("USD", "GBP", 0.50, validUntil = validUntilTime)
     rateToUSD = ExchangeRate("USD", "USD", 1.00, validUntil = validUntilTime)
     writeRatesIntoCache("USD", [rateToEUR, rateToGBP, rateToUSD])
    def setUp(self):
        validUntilTime = time.time() + 2

        writeCurrenciesIntoCacheFile(["EUR", "GBP", "USD"],
                                     validUntil=validUntilTime)
        rateToEUR = ExchangeRate("USD", "EUR", 2.50, validUntil=validUntilTime)
        rateToGBP = ExchangeRate("USD", "GBP", 0.50, validUntil=validUntilTime)
        rateToUSD = ExchangeRate("USD", "USD", 1.00, validUntil=validUntilTime)
        writeRatesIntoCache("USD", [rateToEUR, rateToGBP, rateToUSD])
Esempio n. 3
0
 def _getExchangeRatesFromWebService(self, inputCurrency, outputCurrencies):
     rates = getExchangeRatesFromWebService(inputCurrency, outputCurrencies)
     if self.useCache:
         writeRatesIntoCache(inputCurrency, rates)
     return rates
 def _getExchangeRatesFromWebService(self, inputCurrency, outputCurrencies):
     rates = getExchangeRatesFromWebService(inputCurrency, outputCurrencies)
     if self.useCache:
         writeRatesIntoCache(inputCurrency, rates)
     return rates