| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- """Synthetic receipt shapes retained only for old debug-fixture compatibility."""
- import copy
- import unittest
- from plugins import ita_plugin
- from tools import debug_ita_reservation as diagnostic
- HEADERS = ["Codice Prenotazione", "Ufficio", "Servizio", "Data", "Ora", "Stato"]
- def detail():
- return {"path": "/ReservationDetail/Index/synthetic-link", "statusCode": "3", "fields": {
- "Servizio Consolare": "Visti", "Servizio Erogato": "Visti Nazionali e Schengen",
- "Codice Prenotazione": "SYNTHETIC-REFERENCE", "Tipo Prenotazione": "Prenotazione Singola",
- "Data": "13 ottobre 2026", "Ora": "10:25", "Stato": "Annullata",
- }}
- def listing():
- return {"path": "/Reservation", "tables": [{
- "id": "dataTableReservations", "structuralEmpty": False,
- "headers": [*HEADERS, ""], "count": 1,
- "rows": [{"reference": "SYNTHETIC-REFERENCE", "office": "Visti",
- "service": "Visti Nazionali e Schengen", "date": "13 ottobre 2026",
- "time": "10:25", "status": "Annullata"}],
- }, {"id": "dataTableReservationsWL", "structuralEmpty": True}]}
- def confirmed_detail():
- raw = copy.deepcopy(detail())
- raw.update(path="/ReservationDetail/Index/confirmed-synthetic", statusCode="2")
- raw["fields"].update({"Codice Prenotazione": "CONFIRMED-SYNTHETIC",
- "Data": "3 settembre 2026", "Ora": "09:26", "Stato": "Confermata"})
- return raw
- def confirmed_listing():
- raw = copy.deepcopy(listing())
- raw["tables"][0]["rows"].append({
- **raw["tables"][0]["rows"][0], "reference": "CONFIRMED-SYNTHETIC",
- "date": "3 settembre 2026", "time": "09:26", "status": "Confermata",
- })
- raw["tables"][0]["count"] = 2
- return raw
- class RetiredReservationTests(unittest.TestCase):
- def test_runtime_has_no_receipt_attribution_state_machine(self):
- for name in ("ReservationState", "ReservationRecord", "read_reservation_listing"):
- self.assertFalse(hasattr(ita_plugin, name), name)
- def test_diagnostic_reports_retirement_without_external_io(self):
- self.assertEqual(diagnostic.main([]), 0)
- with self.assertRaises(diagnostic.ReservationDiagnosticRetired):
- diagnostic.parse_reservation_detail(detail())
- if __name__ == "__main__":
- unittest.main()
|