test_run_hive_gap_mysql.py 870 B

1234567891011121314151617181920212223242526272829303132
  1. import unittest
  2. from examples.demand.run_hive_gap_mysql import _build_scope
  3. class RunHiveGapMySQLTest(unittest.TestCase):
  4. def test_build_scope_defaults_platform_to_piaoquan(self):
  5. scope = _build_scope(
  6. {"cluster_name": "历史名人", "gap_dt": "20260624", "lack_count": 3},
  7. execution_id=581,
  8. count=5,
  9. )
  10. self.assertEqual(scope["platform"], "piaoquan")
  11. def test_build_scope_canonicalizes_piaoquan_label(self):
  12. scope = _build_scope(
  13. {
  14. "cluster_name": "历史名人",
  15. "platform_type": "票圈",
  16. "gap_dt": "20260624",
  17. "lack_count": 3,
  18. },
  19. execution_id=581,
  20. count=5,
  21. )
  22. self.assertEqual(scope["platform"], "piaoquan")
  23. if __name__ == "__main__":
  24. unittest.main()