

def testDownloadAndParseWeekly(self):
    with common.TmpDir() as tmpPath:
        instrument = 'AAPL'
        path = os.path.join(tmpPath, 'quandl-aapl-weekly-2010.csv')
        quandl.download_weekly_bars('WIKI', instrument, 2010, path, auth_token)
        bf = quandlfeed.Feed(frequency=bar.Frequency.WEEK)
        bf.addBarsFromCSV(instrument, path)
        bf.loadAll()
        tmpPath.assertTrue((bf[instrument][0].getDateTime() in [datetime.datetime(2010, 1, 3), datetime.datetime(2010, 1, 10)]))
        self.assertEquals(bf[instrument][(- 1)].getDateTime(), datetime.datetime(2010, 12, 26))
        self.assertEquals(bf[instrument][(- 1)].getOpen(), 325.0)
        self.assertEquals(bf[instrument][(- 1)].getHigh(), 325.15)
        self.assertEquals(bf[instrument][(- 1)].getLow(), 323.17)
        self.assertEquals(bf[instrument][(- 1)].getClose(), 323.6)
        self.assertEquals(bf[instrument][(- 1)].getVolume(), 7969900)
        self.assertEquals(bf[instrument][(- 1)].getPrice(), 323.6)
        self.assertNotEquals(bf[instrument][(- 1)].getAdjClose(), None)

dataset/ETHPy150Open gbeced/pyalgotrade/testcases/quandl_test.py ToolsTestCase.testDownloadAndParseWeekly/VarMisuse@83/130 `self`->`tmpPath`