#!/usr/bin/env python3 """Tests for fetch_cloudtrail_s3_data_events.py, on a page in the S3 user guide's markup.""" from __future__ import annotations import pytest import fetch_cloudtrail_s3_data_events as f def row(console: str, kind: str, apis: list[str]) -> str: """A row of the data events table, its APIs an itemized list as the guide lays them out.""" items = "".join(f'
{api.split(" (")[0]}{api[len(api.split(" (")[0]):]}
{kind}When you call PutObjectRetention, the CloudTrail data event is\n'
' recorded with the eventName\n PutObjectLockRetention'
', and includes\n objectRetentionInfo in\n'
' additionalEventData.
Amazon S3 logs all control plane operations as management events.
' '| Data event type (console) | resources.type value | ' 'Data APIs logged to CloudTrail |
|---|
Amazon S3 logs all control plane operations as management events.
") == [] def test_a_page_whose_layout_changed_is_refused(): with pytest.raises(ValueError, match="no table headed"): f.read_data_events(PAGE.replace("resources.type value", "Resource type")) with pytest.raises(ValueError, match="lists no resource type"): f.read_data_events(PAGE.split("| Data event type (console) | ' "resources.type value | Data APIs logged to CloudTrail |
|---|