plan to encode row indentation as int & include it as the 1st element in the data tuple
This commit is contained in:
+19
-4
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user