diff --git a/tests/test_functions.py b/tests/test_functions.py index cf84aa8..cad26ea 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -160,11 +160,32 @@ class FunctionsTestCase(IsolatedAsyncioTestCase): CF: {END_DATE: mock_end_dates, 'c': (3, 4)} } symbol, quarterly, mock_session = 'foo', False, MagicMock() - output = await functions.get_company_financials(symbol, quarterly, mock_session) + output = await functions.get_company_financials(symbol, quarterly=quarterly, session=mock_session) self.assertDictEqual(expected_output, output) mock_get_bs.assert_called_once_with(symbol, quarterly, mock_session) mock_get_is.assert_called_once_with(symbol, quarterly, mock_session) mock_get_cf.assert_called_once_with(symbol, quarterly, mock_session) + mock_get_bs.reset_mock() + mock_get_is.reset_mock() + mock_get_cf.reset_mock() + + test_symbol1, test_symbol2 = 'x', 'y' + expected_output = {test_symbol1: expected_output, test_symbol2: expected_output} + output = await functions.get_company_financials(test_symbol1, test_symbol2, + quarterly=quarterly, session=mock_session) + self.assertDictEqual(expected_output, output) + mock_get_bs.assert_has_calls([ + call(test_symbol1, quarterly, mock_session), + call(test_symbol2, quarterly, mock_session) + ]) + mock_get_is.assert_has_calls([ + call(test_symbol1, quarterly, mock_session), + call(test_symbol2, quarterly, mock_session) + ]) + mock_get_cf.assert_has_calls([ + call(test_symbol1, quarterly, mock_session), + call(test_symbol2, quarterly, mock_session) + ]) @patch.object(functions, 'ClientSession') async def test_integration_get_company_financials(self, mock_session_cls):