Skip to content

Commit 9b07838

Browse files
committed
e2e automation fractional seconds
1 parent 2de15af commit 9b07838

4 files changed

Lines changed: 3 additions & 4 deletions

File tree

lambdas/mns_publisher/tests/test_lambda_handler.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ def test_successful_notification_creation_with_gp(self, mock_logger, mock_get_to
282282

283283
sqs_event = {"Records": [self.sample_sqs_record]}
284284
result = lambda_handler(sqs_event, Mock())
285-
self.maxDiff = None
286285
self.assertEqual(result, {"batchItemFailures": []})
287286

288287
self.assertEqual(mns_response.call_count, 1)

lambdas/shared/src/common/converter_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ def timestamp_to_rfc3339(value: str, field_name: str = "DATE_AND_TIME") -> str:
2020
raise ValueError(f"{field_name} must contain a valid compact timestamp") from e
2121

2222
tz = timezone(timedelta(hours=int(offset_suffix)))
23-
return parsed_date.replace(tzinfo=tz).isoformat(timespec="milliseconds").replace("+00:00", "Z")
23+
return parsed_date.replace(tzinfo=tz).isoformat(timespec="seconds").replace("+00:00", "Z")

tests/e2e_automation/features/APITests/steps/common_steps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ def validate_sqs_message(context, message_body, action):
447447
imms_date_time = normalize_utc_suffix(context.immunization_object.occurrenceDateTime)
448448
check.is_true(
449449
message_body.time == imms_date_time,
450-
f"msn event for {action} Time missing or empty: {message_body.time} {imms_date_time}",
450+
f"msn event for {action} Time missing or mismatch: message_body.time = {message_body.time}, imms_date_time = {imms_date_time}",
451451
)
452452
expected_nhs_number = context.patient.identifier[0].value
453453
if expected_nhs_number is None:

tests/e2e_automation/utilities/date_helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def iso_to_compact(dt_str):
2626

2727
def normalize_utc_suffix(timestamp: str) -> str:
2828
dt = datetime.fromisoformat(timestamp.replace("Z", "+00:00"))
29-
return dt.replace(microsecond=0).isoformat(timespec="milliseconds").replace("+00:00", "Z")
29+
return dt.replace(microsecond=0).isoformat(timespec="seconds").replace("+00:00", "Z")
3030

3131

3232
def is_valid_date(date_str: str) -> bool:

0 commit comments

Comments
 (0)