Пример #1
0
class TestMarket(unittest.TestCase):

    def setUp(self):

        self.market   = Market()
        self.provider = YahooProvider()
        pass

    def testMarketWindow(self):

        startDate = dt.date(2011,1,1)
        endDate   = dt.date(2011,12,31)
        series    = TimeSeries(startDate, endDate)
        symbols   = self.provider.fetchSymbolList('SP5002012')

        window    = MarketWindow(series, symbols)
        self.provider.setMarketWindow(window)

        self.assertEqual(len(series.timestamps), 252)
        self.assertEqual(len(self.provider.window.symbols), 501)
Пример #2
0
    def setUp(self):

        self.market   = Market()
        self.provider = YahooProvider()
        pass