Skip to content

Commit 836eeeb

Browse files
[TESTING] Minor improvement to extra test logic (- WIP PR #373 -)
* this work is related to GHI #213 Changes in file tests/test_extra.py: * new logic to dynamicly check results
1 parent 357247a commit 836eeeb

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

tests/test_extra.py

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,21 @@ def test_sanitize_url_GIVEN_raw_url_IS_reliable(self) -> None:
7575
"""Test case 1: Test to ensure reliable URL sanitization."""
7676
# Mock _hearstep to return a non-empty response
7777
for test_params in self.URL_TEST_FIXTURES:
78+
sanitized_url = docs.utils.sanitize_url(test_params["input_url"])
79+
# check for results
80+
self.assertIsNotNone(sanitized_url)
81+
# Verify results
7882
if test_params["input_url"] == test_params["expected"]:
79-
continue
80-
else:
81-
self.assertNotEqual(
82-
test_params["input_url"],
83-
test_params["expected"],
84-
"Invalid test case. Input and expected URLs were the same, but not skipped.",
83+
self.assertEqual(
84+
test_params["input_url"], sanitized_url,
85+
"Input and output URLs were different, should be the same.",
8586
)
86-
sanitized_url = docs.utils.sanitize_url(test_params["input_url"])
87-
# check for results
88-
self.assertIsNotNone(sanitized_url)
89-
# Verify results
87+
else:
9088
self.assertNotEqual(
9189
test_params["input_url"], sanitized_url,
92-
"Invalid test case. Input and output URLs were the same, should be skipped.",
90+
"Input and output URLs were the same, should be different.",
9391
)
94-
self.assertEqual(sanitized_url, test_params["expected"])
92+
self.assertEqual(sanitized_url, test_params["expected"])
9593

9694

9795
if __name__ == '__main__':

0 commit comments

Comments
 (0)