提交
This commit is contained in:
1 parent
d08f03ab03
commit
cc843535f5
154 files changed
+17837
-5153
No files matched your search
@@ -3,7 +3,10 @@ from datetime import datetime
|
||||
from types import SimpleNamespace
|
||||
import unittest
|
||||
|
||||
from app.services.qc_work_order_fee_summary import build_protocol_payment_summary
|
||||
from app.services.qc_work_order_fee_summary import (
|
||||
build_protocol_payment_summary,
|
||||
pick_earliest_transfer_time_by_protocol,
|
||||
)
|
||||
|
||||
|
||||
class TestPaymentSummaryTransferTime(unittest.TestCase):
|
||||
@@ -23,6 +26,17 @@ class TestPaymentSummaryTransferTime(unittest.TestCase):
|
||||
self.assertIsNotNone(summary)
|
||||
self.assertEqual(summary["paymentDetails"][0]["transferTime"], "2025-09-15 09:20:00")
|
||||
|
||||
def test_pick_earliest_transfer_time_by_protocol(self):
|
||||
rows = [
|
||||
("p1", datetime(2025, 9, 20, 14, 30, 0)),
|
||||
("p1", datetime(2025, 9, 15, 9, 20, 0)),
|
||||
("p1", datetime(2025, 9, 18, 8, 0, 0)),
|
||||
("p2", datetime(2025, 10, 1, 10, 0, 0)),
|
||||
]
|
||||
got = pick_earliest_transfer_time_by_protocol(rows)
|
||||
self.assertEqual(got["p1"], datetime(2025, 9, 15, 9, 20, 0))
|
||||
self.assertEqual(got["p2"], datetime(2025, 10, 1, 10, 0, 0))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user