diff --git a/src/mwfin/functions.py b/src/mwfin/functions.py index c7a1240..e22133f 100644 --- a/src/mwfin/functions.py +++ b/src/mwfin/functions.py @@ -29,16 +29,16 @@ def extract_end_dates(soup: BeautifulSoup) -> tuple[str]: pass -def find_relevant_table_rows(soup: BeautifulSoup) -> ResultSet: +def is_relevant_table_row(tr: Tag) -> bool: """ - Returns the table rows containing the data of interest. + Returns True if the item in the table row is marked as relevant. Additionally warns when an item is unknown. """ pass -def convert_number(num_str: str) -> int: +def find_relevant_table_rows(soup: BeautifulSoup) -> ResultSet: """ - Takes a string like e.g. "420.69M" and returns 42069000000. + Returns the table rows containing the data of interest. """ pass diff --git a/tests/test_functions.py b/tests/test_functions.py index 3560138..ad4b223 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -44,17 +44,21 @@ class FunctionsTestCase(IsolatedAsyncioTestCase): output = functions.extract_end_dates(self.test_soup) self.assertTupleEqual(expected_output, output) - def test_find_relevant_table_rows(self): - 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 + def test_is_relevant_table_row(self): + test_html = '