| 1234567891011121314151617181920212223242526272829303132 |
- import unittest
- from examples.demand.run_hive_gap_mysql import _build_scope
- class RunHiveGapMySQLTest(unittest.TestCase):
- def test_build_scope_defaults_platform_to_piaoquan(self):
- scope = _build_scope(
- {"cluster_name": "历史名人", "gap_dt": "20260624", "lack_count": 3},
- execution_id=581,
- count=5,
- )
- self.assertEqual(scope["platform"], "piaoquan")
- def test_build_scope_canonicalizes_piaoquan_label(self):
- scope = _build_scope(
- {
- "cluster_name": "历史名人",
- "platform_type": "票圈",
- "gap_dt": "20260624",
- "lack_count": 3,
- },
- execution_id=581,
- count=5,
- )
- self.assertEqual(scope["platform"], "piaoquan")
- if __name__ == "__main__":
- unittest.main()
|