import unittest from datetime import UTC,datetime from scheduling_core.policy import PolicyConfig,PolicyViolation from scheduling_core.slotting import compliant_slots class SlotTests(unittest.TestCase): def test_offers_three_default_duration_slots_and_rejects_no_availability(self): c=PolicyConfig(revision='x',fixed_sender='petra@example.test'); now=datetime(2030,12,31,16,tzinfo=UTC) slots=compliant_slots(transaction_id='x',requester='r@example.test',sender='petra@example.test',authentication_evidence_id='a',availability_evidence_id='b',now=now,busy_intervals=[],config=c) self.assertEqual(len(slots),3) blocked=[{'start_at':'2031-01-01T00:00:00Z','end_at':'2031-01-22T00:00:00Z'}] with self.assertRaises(PolicyViolation): compliant_slots(transaction_id='y',requester='r@example.test',sender='petra@example.test',authentication_evidence_id='a',availability_evidence_id='b',now=now,busy_intervals=blocked,config=c)