more unit tests
This commit is contained in:
parent
d504ddfc33
commit
8041386d52
@ -45,16 +45,28 @@ class FunctionsTestCase(IsolatedAsyncioTestCase):
|
|||||||
self.assertTupleEqual(expected_output, output)
|
self.assertTupleEqual(expected_output, output)
|
||||||
|
|
||||||
def test_find_relevant_table_rows(self):
|
def test_find_relevant_table_rows(self):
|
||||||
pass
|
test_table = self.test_soup.find('div', attrs={'class': 'financials'}).div.div.table
|
||||||
|
expected_output = [test_table.thead.tr, test_table.tbody.tr]
|
||||||
|
# print(expected_output) # debug
|
||||||
|
output = functions.find_relevant_table_rows(self.test_soup)
|
||||||
|
self.assertListEqual(expected_output, output)
|
||||||
|
|
||||||
def test_convert_number(self):
|
def test_convert_number(self):
|
||||||
|
# likely not necessary if data-chart-data is used
|
||||||
|
# e.g. floats may be converted on extraction
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def test_extract_row_data(self):
|
def test_extract_row_data(self):
|
||||||
pass
|
test_table = self.test_soup.find('div', attrs={'class': 'financials'}).div.div.table
|
||||||
|
expected_output = ('Item_1', (11000000.0, -22000000.0))
|
||||||
|
output = functions.extract_row_data(test_table.tbody.tr)
|
||||||
|
# print(test_table.tbody.tr) # debug
|
||||||
|
self.assertTupleEqual(expected_output, output)
|
||||||
|
|
||||||
def test_extract_all_data(self):
|
def test_extract_all_data(self):
|
||||||
pass
|
expected_output = {'Item_1': (11000000.0, -22000000.0)}
|
||||||
|
output = functions.extract_row_data(self.test_soup)
|
||||||
|
self.assertDictEqual(expected_output, output)
|
||||||
|
|
||||||
async def test_get_balance_sheet(self):
|
async def test_get_balance_sheet(self):
|
||||||
pass
|
pass
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><div> 'Item' </div><div> 'Item' </div></th>
|
<th><div> !!Item </div><div> !!Item </div></th>
|
||||||
<th><div> End_Date_1 </div></th>
|
<th><div> End_Date_1 </div></th>
|
||||||
<th><div> End_Date_2 </div></th>
|
<th><div> End_Date_2 </div></th>
|
||||||
<th></th>
|
<th></th>
|
||||||
|
Loading…
Reference in New Issue
Block a user