Skip to content

Commit

Permalink
test case for calendar data
Browse files Browse the repository at this point in the history
  • Loading branch information
rickturner2001 committed Oct 18, 2023
1 parent 7ca5e11 commit d16a589
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/ticker.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
"""
import pandas as pd

from yfinance.scrapers.quote import CalendarData

from .context import yfinance as yf
from .context import session_gbl
from yfinance.exceptions import YFNotImplementedError
Expand Down Expand Up @@ -597,6 +599,15 @@ def test_quarterly_balance_sheet(self):
data = self.ticker.get_balance_sheet(as_dict=True, freq="quarterly")
self.assertIsInstance(data, dict, "data has wrong type")

def test_ticker_calendar_earnigns(self):
calendar = self.ticker.calendar
calendar_df = calendar.get()
self.assertIsInstance(calendar, CalendarData)
if calendar_df is not None:

self.assertIsInstance(calendar_df, pd.DataFrame)
self.assertTrue(len(calendar_df) > 0)

def test_cash_flow(self):
expected_keys = ["Operating Cash Flow", "Net PPE Purchase And Sale"]
expected_periods_days = 365
Expand Down

0 comments on commit d16a589

Please sign in to comment.