Check Request ID format on S3 call (#750)

This commit is contained in:
(Eliseo) Nathaniel Ruiz Nowell
2021-10-19 03:18:58 -04:00
committed by GitHub
parent 9e57fbad8e
commit f13b339a91
2 changed files with 6 additions and 4 deletions

View File

@ -45,7 +45,7 @@ install_requires =
[options.extras_require]
test =
moto[all] ~= 2.0
moto[all] ~= 2.2.6
opentelemetry-test == 0.25b1
[options.packages.find]

View File

@ -178,15 +178,17 @@ class TestBotocoreInstrumentor(TestBase):
location = {"LocationConstraint": "us-west-2"}
s3.create_bucket(Bucket="mybucket", CreateBucketConfiguration=location)
self.assert_span("S3", "CreateBucket")
self.assert_span(
"S3", "CreateBucket", request_id=_REQUEST_ID_REGEX_MATCH
)
self.memory_exporter.clear()
s3.put_object(Key="foo", Bucket="mybucket", Body=b"bar")
self.assert_span("S3", "PutObject")
self.assert_span("S3", "PutObject", request_id=_REQUEST_ID_REGEX_MATCH)
self.memory_exporter.clear()
s3.get_object(Bucket="mybucket", Key="foo")
self.assert_span("S3", "GetObject")
self.assert_span("S3", "GetObject", request_id=_REQUEST_ID_REGEX_MATCH)
@mock_sqs
def test_sqs_client(self):