feat: sync latest ARR implementation
This commit is contained in:
@@ -10,6 +10,8 @@ from datetime import date
|
||||
from decimal import Decimal
|
||||
from pathlib import Path
|
||||
|
||||
from openpyxl import load_workbook
|
||||
|
||||
from monthly_reports.contracts import (
|
||||
ChannelObservation,
|
||||
DailyVersionPin,
|
||||
@@ -61,7 +63,7 @@ def report_payload() -> dict:
|
||||
report = build_monthly_report(
|
||||
2026,
|
||||
7,
|
||||
date(2026, 7, 26),
|
||||
date(2026, 7, 8),
|
||||
MonthlySnapshot(
|
||||
(source,),
|
||||
(DailyVersionPin(date(2026, 7, 8), 100),),
|
||||
@@ -113,11 +115,24 @@ class MonthlyReportsXlsxTests(unittest.TestCase):
|
||||
"LIANTAI-GROUP", "LIANTAI-FIT", "QBD", "DY-AI-Easy-KB", "FENGRUN"
|
||||
])
|
||||
self.assertEqual(summary["row_counts"], [0, 0, 1, 0, 0])
|
||||
self.assertEqual(summary["formula_count"], 0)
|
||||
self.assertEqual(summary["formula_count"], 1)
|
||||
self.assertEqual(summary["preview_count"], 5)
|
||||
self.assertEqual(len(list(previews.glob("sheet-*.png"))), 5)
|
||||
self.assertEqual(output.stat().st_mode & 0o777, 0o600)
|
||||
self.assertFalse(Path(f"{output}.inspect.ndjson").exists())
|
||||
workbook = load_workbook(output, data_only=False, read_only=True)
|
||||
try:
|
||||
self.assertEqual(workbook["QBD"]["S2"].value, "=R2*C2*G2")
|
||||
formulas = [
|
||||
cell.value
|
||||
for sheet in workbook.worksheets
|
||||
for row in sheet.iter_rows()
|
||||
for cell in row
|
||||
if cell.data_type == "f"
|
||||
]
|
||||
self.assertEqual(formulas, ["=R2*C2*G2"])
|
||||
finally:
|
||||
workbook.close()
|
||||
|
||||
def test_invalid_payload_returns_only_stable_error_code(self):
|
||||
node = node_binary()
|
||||
|
||||
Reference in New Issue
Block a user