test(py-monitor): run test_strips_progressive_thumbnail
This commit is contained in:
1 parent
1f457dc4b3
commit
7102e2b3fd
1 file changed
+20
@@ -0,0 +1,20 @@
|
||||
"""Unit tests for the extracted primitives (stdlib unittest, no deps)."""
|
||||
import os
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
|
||||
|
||||
from monitor_core import (normalize_product_url, normalize_condition, parse_price,
|
||||
strip_thumbnail_suffix, title_matches_keyword, iso_from_epoch, iso_now)
|
||||
|
||||
|
||||
class UrlTests(unittest.TestCase):
|
||||
|
||||
def test_strips_progressive_thumbnail(self):
|
||||
url = "https://media.example.com/abc.jpg_progressive_thumbnail"
|
||||
self.assertEqual("https://media.example.com/abc.jpg", strip_thumbnail_suffix(url))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user