# Path: fooltrader/api/fundamental.py
# def get_balance_sheet_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                             return_type='json'):
# def get_income_statement_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                                return_type='json'):
# def get_cash_flow_statement_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                                   return_type='json'):
# def get_finance_summary_items(security_item, start_date=None, report_period=None):
# def _download_finance_data_if_need(the_path, the_code):
#         EPS = lines[25].split()[1:-1]


from fooltrader.api import fundamental


def test_get_balance_sheet_items():
    balance_sheets = fundamental.get_balance_sheet_items('600977', start_date='2016-06-30')
    assert len(balance_sheets) > 0
    for item in balance_sheets:
        assert item['totalBookValue'] > 0
        assert item['reportEventDate'] > item['reportPeriod']


def test_get_income_statement_items():

# Path: fooltrader/api/fundamental.py
# def get_balance_sheet_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                             return_type='json'):
# def get_income_statement_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                                return_type='json'):
# def get_cash_flow_statement_items(security_item, start_date=None, report_period=None, report_event_date=None,
#                                   return_type='json'):
# def get_finance_summary_items(security_item, start_date=None, report_period=None):
# def _download_finance_data_if_need(the_path, the_code):
#         EPS = lines[25].split()[1:-1]


# Path: tests/test_finance.py
from fooltrader.api import fundamental



def test_get_balance_sheet_items():
    balance_sheets = fundamental.get_balance_sheet_items('600977', start_date='2016-06-30')
    assert len(balance_sheets) > 0
    for item in balance_sheets:
        assert item['totalBookValue'] > 0
        assert item['reportEventDate'] > item['reportPeriod']


def test_get_income_statement_items():

    income_statements = fundamental.get_income_statement_items('600977', start_date='2016-06-30')