Skip to content

Commit

Permalink
Remove unecessary dict casting
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanielRN committed Nov 11, 2020
1 parent b010622 commit cb661e3
Showing 1 changed file with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_traced_client(self):
span = spans[0]
self.assertEqual(len(spans), 1)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "DescribeInstances",
"aws.region": "us-west-2",
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_s3_client(self):
span = spans[0]
self.assertEqual(len(spans), 2)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "ListBuckets",
"aws.region": "us-west-2",
Expand All @@ -123,7 +123,7 @@ def test_s3_client(self):
assert spans
span = spans[2]
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "ListObjects",
"aws.region": "us-west-2",
Expand All @@ -144,7 +144,7 @@ def test_s3_put(self):
spans = self.memory_exporter.get_finished_spans()
assert spans
self.assertEqual(len(spans), 3)
create_bucket_attributes = dict(spans[0].attributes)
create_bucket_attributes = spans[0].attributes
self.assertEqual(
create_bucket_attributes,
{
Expand All @@ -154,7 +154,7 @@ def test_s3_put(self):
"http.status_code": 200,
},
)
put_object_attributes = dict(spans[1].attributes)
put_object_attributes = spans[1].attributes
self.assertEqual(
put_object_attributes,
{
Expand All @@ -165,7 +165,7 @@ def test_s3_put(self):
},
)
self.assertTrue("params.Body" not in spans[1].attributes.keys())
get_object_attributes = dict(spans[2].attributes)
get_object_attributes = spans[2].attributes
self.assertEqual(
get_object_attributes,
{
Expand All @@ -186,7 +186,7 @@ def test_sqs_client(self):
assert spans
span = spans[0]
self.assertEqual(len(spans), 1)
actual = dict(span.attributes)
actual = span.attributes
self.assertRegex(actual["aws.request_id"], r"[A-Z0-9]{52}")
del actual["aws.request_id"]
self.assertEqual(
Expand Down Expand Up @@ -214,7 +214,7 @@ def test_sqs_send_message(self):
spans = self.memory_exporter.get_finished_spans()
assert spans
self.assertEqual(len(spans), 2)
create_queue_attributes = dict(spans[0].attributes)
create_queue_attributes = spans[0].attributes
self.assertRegex(
create_queue_attributes["aws.request_id"], r"[A-Z0-9]{52}"
)
Expand All @@ -228,7 +228,7 @@ def test_sqs_send_message(self):
"http.status_code": 200,
},
)
send_msg_attributes = dict(spans[1].attributes)
send_msg_attributes = spans[1].attributes
self.assertRegex(
send_msg_attributes["aws.request_id"], r"[A-Z0-9]{52}"
)
Expand Down Expand Up @@ -257,7 +257,7 @@ def test_kinesis_client(self):
span = spans[0]
self.assertEqual(len(spans), 1)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "ListStreams",
"aws.region": "us-east-1",
Expand Down Expand Up @@ -302,7 +302,7 @@ def test_lambda_client(self):
span = spans[0]
self.assertEqual(len(spans), 1)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "ListFunctions",
"aws.region": "us-east-1",
Expand All @@ -322,7 +322,7 @@ def test_kms_client(self):
span = spans[0]
self.assertEqual(len(spans), 1)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "ListKeys",
"aws.region": "us-east-1",
Expand All @@ -345,7 +345,7 @@ def test_sts_client(self):
span = spans[0]
self.assertEqual(len(spans), 1)
self.assertEqual(
dict(span.attributes),
span.attributes,
{
"aws.operation": "GetCallerIdentity",
"aws.region": "us-east-1",
Expand Down Expand Up @@ -383,7 +383,7 @@ def test_dynamodb_client(self):
spans = self.memory_exporter.get_finished_spans()
assert spans
self.assertEqual(len(spans), 3)
create_table_attributes = dict(spans[0].attributes)
create_table_attributes = spans[0].attributes
self.assertRegex(
create_table_attributes["aws.request_id"], r"[A-Z0-9]{52}"
)
Expand All @@ -398,7 +398,7 @@ def test_dynamodb_client(self):
"http.status_code": 200,
},
)
put_item_attributes = dict(spans[1].attributes)
put_item_attributes = spans[1].attributes
self.assertRegex(
put_item_attributes["aws.request_id"], r"[A-Z0-9]{52}"
)
Expand All @@ -413,7 +413,7 @@ def test_dynamodb_client(self):
"http.status_code": 200,
},
)
get_item_attributes = dict(spans[2].attributes)
get_item_attributes = spans[2].attributes
self.assertRegex(
get_item_attributes["aws.request_id"], r"[A-Z0-9]{52}"
)
Expand Down

0 comments on commit cb661e3

Please sign in to comment.