def testDownloadAndParseWeekly(self):
        instrument = "aapl"

        with common.TmpDir() as tmp_path:
            path = os.path.join(tmp_path, "aapl-weekly-2013.csv")
            yahoofinance.download_weekly_bars(instrument, 2013, path)
            bf = yahoofeed.Feed(frequency=bar.Frequency.WEEK)
            bf.addBarsFromCSV(instrument, path)
            bf.loadAll()
            self.assertEqual(round(bf[instrument][-1].getOpen(), 2), 557.46)
            self.assertEqual(round(bf[instrument][-1].getHigh(), 2), 561.28)
            self.assertEqual(round(bf[instrument][-1].getLow(), 2), 540.43)
            self.assertEqual(round(bf[instrument][-1].getClose(), 2), 540.98)
            self.assertTrue(bf[instrument][-1].getVolume() in (9852500, 9855900, 68991600))
dataset/ETHPy150Open gbeced/pyalgotrade/testcases/yahoo_test.py/ToolsTestCase.testDownloadAndParseWeekly/original