From f29f22a52e7e6d84898d73ff130cb658a2a318c8 Mon Sep 17 00:00:00 2001 From: Daniil Fajnberg Date: Sun, 26 Dec 2021 23:32:15 +0100 Subject: [PATCH] 100% coverage --- .coveragerc | 2 ++ src/mwfin/exceptions.py | 6 ------ tests/test_functions.py | 5 ++++- 3 files changed, 6 insertions(+), 7 deletions(-) delete mode 100644 src/mwfin/exceptions.py diff --git a/.coveragerc b/.coveragerc index ab5ddf4..cee8dcb 100644 --- a/.coveragerc +++ b/.coveragerc @@ -8,3 +8,5 @@ omit = fail_under = 100 show_missing = True skip_covered = True +exclude_lines = + if __name__ == .__main__.: diff --git a/src/mwfin/exceptions.py b/src/mwfin/exceptions.py deleted file mode 100644 index 8480063..0000000 --- a/src/mwfin/exceptions.py +++ /dev/null @@ -1,6 +0,0 @@ -class WrongAssumptions(Exception): - pass - - -class UnexpectedMarkup(WrongAssumptions): - pass diff --git a/tests/test_functions.py b/tests/test_functions.py index 8b24758..0dbe293 100644 --- a/tests/test_functions.py +++ b/tests/test_functions.py @@ -52,8 +52,11 @@ class FunctionsTestCase(IsolatedAsyncioTestCase): self.assertEqual(expected_output, output) def test_get_row_indent(self): - trs = self.test_soup.find_all('tr') + mock_row = BeautifulSoup('
foo
', HTML_PARSER).tr expected_output = 0 + output = functions.get_row_indent(mock_row) + self.assertEqual(expected_output, output) + trs = self.test_soup.find_all('tr') output = functions.get_row_indent(trs[0]) self.assertEqual(expected_output, output) for i, tr in enumerate(trs[1:], start=1):