MCPcopy Create free account
hub / github.com/awsdocs/aws-doc-sdk-examples / test_delete

Function test_delete

python/example_code/ssm/test/test_document.py:69–87  ·  view source on GitHub ↗
(make_stubber, error_code)

Source from the content-addressed store, hash-verified

67
68@pytest.mark.parametrize("error_code", [None, "TestException"])
69def test_delete(make_stubber, error_code):
70 ssm_client = boto3.client("ssm")
71 ssm_stubber = make_stubber(ssm_client)
72 document_wrapper = DocumentWrapper(ssm_client)
73 name = "python-test"
74 document_wrapper.name = name
75
76 ssm_stubber.stub_delete_document(
77 name,
78 error_code=error_code,
79 )
80
81 if error_code is None:
82 document_wrapper.delete()
83 assert document_wrapper.name is None
84 else:
85 with pytest.raises(ClientError) as exc_info:
86 document_wrapper.delete()
87 assert exc_info.value.response["Error"]["Code"] == error_code
88
89
90@pytest.mark.parametrize("error_code", [None, "TestException"])

Callers

nothing calls this directly

Calls 3

deleteMethod · 0.95
DocumentWrapperClass · 0.90
stub_delete_documentMethod · 0.80

Tested by

no test coverage detected