Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(8)  |  Call(8)  |  Derive(0)  |  Import(0)
Fail if the two objects are unequal as determined by the '=='
operator.

src/q/u/quant-0.8/src/quant/pricer/basetest.py   quant(Download)
        expectedValue = round(self.expectedValue, self.DECIMALS)
        msg = "Value: %s  Expected: %s  Strike: %s  Current: %s  Volatility: %s  Rate: %s" % (roundedValue, expectedValue, self.strikePrice, self.lastPrice, self.actualHistoricalVolatility, self.annualRiskFreeRate)
        self.assertEqual(roundedValue, expectedValue, msg)
 
        # Check option delta.
        expectedDelta = round(self.expectedDelta, self.DECIMALS)
        msg = "Delta: %s  Expected: %s  Strike: %s  Current: %s  Volatility: %s  Rate: %s" % (roundedDelta, expectedDelta, self.strikePrice, self.lastPrice, self.actualHistoricalVolatility, self.annualRiskFreeRate)
        self.assertEqual(roundedDelta, expectedDelta, msg)
 
        # Check option gamma.
        expectedGamma = round(self.expectedGamma, self.DECIMALS)
        msg = "Gamma: %s  Expected: %s  Strike: %s  Current: %s  Volatility: %s  Rate: %s" % (roundedGamma, expectedGamma, self.strikePrice, self.lastPrice, self.actualHistoricalVolatility, self.annualRiskFreeRate)
        self.assertEqual(roundedGamma, expectedGamma, msg)
 

src/q/u/quant-0.8/src/quant/dom/booktest.py   quant(Download)
    def test_book(self):
        self.assertTrue(self.book)
        self.assertEqual(len(self.book.getContracts()), 2)
 
 

src/q/u/quant-0.8/src/quant/markettest.py   quant(Download)
    def test_getLastPrice(self):
        for i in range(len(self.expectedMarkets)):
            market = self.expectedMarkets[i]
            lastPrice = self.market.getLastPrice(market=market)
            self.assertEqual(lastPrice, self.expectedLastPrices[i])
    def test_getActualHistoricalVolatility(self):
        for i in range(len(self.expectedMarkets)):
            market = self.expectedMarkets[i]
            actualHistoricalVolatility = self.market.getActualHistoricalVolatility(market=market) 
            self.assertEqual(actualHistoricalVolatility, self.expectedVolatilities[i])
 
    def test_getNowTime(self):
        self.assertEqual(self.market.getNowTime(), self.expectedNowTime)
    def test_getPriceProcess(self):
        self.assertEqual(type(self.market.getPriceProcess()), self.expectedPriceProcessClass)