plan to encode row indentation as int & include it as the 1st element in the data tuple

This commit is contained in:
2021-12-26 18:08:25 +01:00
parent c93fb9692e
commit f7cb5de928
2 changed files with 28 additions and 7 deletions
+19 -4
View File
@@ -63,7 +63,7 @@ class FunctionsTestCase(IsolatedAsyncioTestCase):
def test_extract_row_data(self):
test_row = self.test_soup.find('div', attrs={'class': 'financials'}).tbody.tr
expected_output = ('foo', (1., -2.))
expected_output = ('foo', (1, 1., -2.))
output = functions.extract_row_data(test_row)
self.assertTupleEqual(expected_output, output)
@@ -197,9 +197,24 @@ class FunctionsTestCase(IsolatedAsyncioTestCase):
symbol = 'foo'
# Since the web request is mocked we always receive the same HTML markup.
expected_output = {
BS: {END_DATE: ('End_Date_1', 'End_Date_2'), 'foo': (1., -2.), 'bar': (2., -3.)},
IS: {END_DATE: ('End_Date_1', 'End_Date_2'), 'foo': (1., -2.), 'bar': (2., -3.)},
CF: {END_DATE: ('End_Date_1', 'End_Date_2'), 'foo': (1., -2.), 'bar': (2., -3.)}
BS: {
END_DATE: ('End_Date_1', 'End_Date_2'),
'foo': (1, 1., -2.),
'bar': (2, 2., -3.),
'baz': (3, 3., -4.)
},
IS: {
END_DATE: ('End_Date_1', 'End_Date_2'),
'foo': (1, 1., -2.),
'bar': (2, 2., -3.),
'baz': (3, 3., -4.)
},
CF: {
END_DATE: ('End_Date_1', 'End_Date_2'),
'foo': (1, 1., -2.),
'bar': (2, 2., -3.),
'baz': (3, 3., -4.)
}
}
output = await functions.get_all_financials(symbol, session=mock_session_obj)
self.assertDictEqual(expected_output, output)