allow getting specific financial statement for multiple companies
This commit is contained in:
parent
3c7afcd879
commit
1529df252c
@ -133,9 +133,19 @@ class FunctionsTestCase(IsolatedAsyncioTestCase):
|
|||||||
function = functions.get_cash_flow_statement
|
function = functions.get_cash_flow_statement
|
||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
output = await function(symbol, quarterly, mock_session)
|
output = await function(symbol, quarterly=quarterly, session=mock_session)
|
||||||
self.assertEqual(expected_output, output)
|
self.assertEqual(expected_output, output)
|
||||||
mock__get_financial_statement.assert_called_once_with(statement, symbol, quarterly, mock_session)
|
mock__get_financial_statement.assert_called_once_with(statement, symbol, quarterly, mock_session)
|
||||||
|
mock__get_financial_statement.reset_mock()
|
||||||
|
|
||||||
|
symbol1, symbol2 = 'x', 'y'
|
||||||
|
expected_output = {symbol1: expected_output, symbol2: expected_output}
|
||||||
|
output = await function(symbol1, symbol2, quarterly=quarterly, session=mock_session)
|
||||||
|
self.assertDictEqual(expected_output, output)
|
||||||
|
mock__get_financial_statement.assert_has_calls([
|
||||||
|
call(statement, symbol1, quarterly, mock_session),
|
||||||
|
call(statement, symbol2, quarterly, mock_session),
|
||||||
|
])
|
||||||
|
|
||||||
@patch.object(functions, '_get_financial_statement')
|
@patch.object(functions, '_get_financial_statement')
|
||||||
async def test_get_balance_sheet(self, mock__get_financial_statement):
|
async def test_get_balance_sheet(self, mock__get_financial_statement):
|
||||||
|
Loading…
Reference in New Issue
Block a user