feat: sync latest ARR implementation
This commit is contained in:
@@ -78,7 +78,7 @@ class MonthlyReportsCoreTests(unittest.TestCase):
|
||||
report = build_monthly_report(
|
||||
2026,
|
||||
7,
|
||||
date(2026, 7, 26),
|
||||
date(2026, 7, 2),
|
||||
snapshot(
|
||||
fact(2, channel="T- HANATOUR TD CO., L"),
|
||||
fact(1),
|
||||
@@ -92,13 +92,13 @@ class MonthlyReportsCoreTests(unittest.TestCase):
|
||||
)
|
||||
self.assertEqual(report.row_count, 2)
|
||||
self.assertEqual(report.channel_manifest[-1], ("T- HANATOUR TD CO., L", 6, 1))
|
||||
self.assertEqual(report.filename, "各渠道情况-2026年07月-更新至7.26.xlsx")
|
||||
self.assertEqual(report.filename, "各渠道情况-2026年07月-更新至7.2.xlsx")
|
||||
|
||||
def test_kb_payload_has_extra_typed_amount(self):
|
||||
report = build_monthly_report(
|
||||
2026,
|
||||
7,
|
||||
date(2026, 7, 26),
|
||||
date(2026, 7, 2),
|
||||
snapshot(fact(1, channel="DY-AI-Easy-KB", rooms=2)),
|
||||
)
|
||||
|
||||
@@ -122,6 +122,18 @@ class MonthlyReportsCoreTests(unittest.TestCase):
|
||||
self.assertEqual(report.row_count, 0)
|
||||
self.assertEqual(report.daily_versions[0].daily_version_id, 126)
|
||||
|
||||
def test_nonempty_report_rejects_as_of_after_greatest_arrival(self):
|
||||
with self.assertRaises(MonthlyReportError) as caught:
|
||||
build_monthly_report(
|
||||
2026,
|
||||
7,
|
||||
date(2026, 7, 30),
|
||||
snapshot(fact(1, business_date=date(2026, 7, 27))),
|
||||
)
|
||||
|
||||
self.assertEqual(caught.exception.code, ErrorCode.SOURCE_INVALID)
|
||||
self.assertIn("greatest included ARRIVAL", caught.exception.safe_message)
|
||||
|
||||
def test_mismatched_metric_or_pin_is_rejected(self):
|
||||
source = fact(1)
|
||||
cases = (
|
||||
|
||||
Reference in New Issue
Block a user