test(py-monitor): run test_normalize_handles_empty
This commit is contained in:
1 parent
1f4a784db8
commit
2a334fa97d
1 file changed
+13
@@ -19,6 +19,19 @@ class UrlTests(unittest.TestCase):
|
||||
url = "https://media.example.com/abc.jpg"
|
||||
self.assertEqual(url, strip_thumbnail_suffix(url))
|
||||
|
||||
def test_strip_keeps_empty_input(self):
|
||||
self.assertEqual("", strip_thumbnail_suffix(""))
|
||||
|
||||
def test_normalize_drops_query_and_fragment(self):
|
||||
a = "https://www.carousell.com.my/p/1234/?utm_source=x#top"
|
||||
b = "https://WWW.Carousell.com.my/p/1234/"
|
||||
self.assertEqual(normalize_product_url(a), normalize_product_url(b))
|
||||
self.assertEqual("https://www.carousell.com.my/p/1234", normalize_product_url(a))
|
||||
|
||||
def test_normalize_handles_empty(self):
|
||||
self.assertEqual("", normalize_product_url(None))
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user