From 1529df252ce24ceef86b05d8c9378030272c9431 Mon Sep 17 00:00:00 2001 From: Daniil Fajnberg Date: Sun, 28 Nov 2021 16:58:21 +0100 Subject: [PATCH] allow getting specific financial statement for multiple companies --- tests/test_functions.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_functions.py b/tests/test_functions.py index 219218a..b46d0db 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -133,9 +133,19 @@ class FunctionsTestCase(IsolatedAsyncioTestCase): function = functions.get_cash_flow_statement else: raise ValueError - output = await function(symbol, quarterly, mock_session) + output = await function(symbol, quarterly=quarterly, session=mock_session) self.assertEqual(expected_output, output) 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') async def test_get_balance_sheet(self, mock__get_financial_statement):