fix: 商品页就绪后立即进入规格面板 (#36)
This commit is contained in:
@@ -9,6 +9,7 @@ from src.pdd_collect_service import (
|
||||
parse_spec_panel,
|
||||
)
|
||||
from src.pdd_device_service import PddDeviceService
|
||||
from src.util.get_size_panle_coord import get_size_panel_coord
|
||||
|
||||
|
||||
REAL_XML = Path(__file__).parents[1] / "image_xml"
|
||||
@@ -74,6 +75,14 @@ class PddRealXmlFixtureTest(unittest.TestCase):
|
||||
self.assertEqual(result.price_cent, 470)
|
||||
self.assertEqual(result.list_price_cent, 1990)
|
||||
|
||||
def test_real_home_xml_has_immediate_spec_entry(self):
|
||||
xml_data = (REAL_XML / "737116531267_home.xml").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
coordinate = get_size_panel_coord(xml_data)
|
||||
self.assertIsNotNone(coordinate)
|
||||
self.assertGreater(coordinate[1], 2000)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user