def setUp(self): turn_on_request_caching() test_filing_path = os.path.join(TEST_DOCS_DIR, 'aapl-20121229.xml') with open(test_filing_path) as f: test_statement_xml_dict = xmltodict.parse(f.read()) self.xbrl_dict = test_statement_xml_dict['xbrl'] self.xbrl_doc = XBRLDocument(None) self.xbrl_doc._xbrl_dict_ = self.xbrl_dict
def test_document_downloading(self): turn_on_request_caching() url = 'http://www.sec.gov/Archives/edgar/data/320193/000119312513022339/aapl-20121229.xml' test_filing_path = os.path.join(TEST_DOCS_DIR, 'aapl-20121229.xml') with open(test_filing_path) as f: test_statement_xml_dict = xmltodict.parse(f.read()) xbrl_dict = test_statement_xml_dict['xbrl'] doc = XBRLDocument.gets_XBRL_from_edgar(xbrl_url=url) self.assertDictEqual(doc._xbrl_dict, xbrl_dict)
def test_quarterly_eps_sqlite(self): turn_on_request_caching() start, end = (datetime.date(2013, 1, 1), datetime.date(2013, 8, 1)) cache = sqlite_fundamentals_cache(metric=QUARTERLY_EPS, db_file_path=':memory:') cache.load_from_cache(stocks=['GOOG', 'AAPL'], start=start, end=end)
def test_quarterly_eps_sqlite(self): turn_on_request_caching() start, end = (datetime.date(2013, 1, 1), datetime.date(2013, 8, 1)) cache = sqlite_fundamentals_cache(metric=QuarterlyEPS, db_file_path=':memory:') cache.load_from_cache(stocks=['GOOG', 'AAPL'], start=start, end=end)
def test_quarterly_eps_sqlite(self): turn_on_request_caching() start, end = (datetime.datetime(2013, 1, 1, tzinfo=pytz.UTC), datetime.datetime(2013, 1, 2, tzinfo=pytz.UTC)) cache = sqlite_fundamentals_cache(metric=QUARTERLY_EPS, db_file_path=':memory:') data = cache.load_from_cache(stocks=['GOOG', 'AAPL'], start=start, end=end) self.assertEqual(data['GOOG'][0], 6.53)
def setUp(self): turn_on_request_caching() HTMLEdgarDriver._ticker_filings = {}
def setUp(self): turn_on_request_caching()
def setUpClass(cls): turn_on_request_caching()