mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-31 22:23:12 +08:00
Add uninstrument test for boto (#1488)
This commit is contained in:
@ -210,6 +210,22 @@ class TestBotoInstrumentor(TestBase):
|
||||
assert spans
|
||||
self.assertEqual(len(spans), 1)
|
||||
|
||||
@mock_s3_deprecated
|
||||
def test_uninstrument(self):
|
||||
s3 = boto.s3.connect_to_region("us-east-1")
|
||||
# Get the created bucket
|
||||
s3.create_bucket("cheese")
|
||||
spans = self.memory_exporter.get_finished_spans()
|
||||
assert spans
|
||||
self.assertEqual(len(spans), 1)
|
||||
|
||||
self.memory_exporter.clear()
|
||||
BotoInstrumentor().uninstrument()
|
||||
|
||||
s3.get_bucket("cheese")
|
||||
spans = self.memory_exporter.get_finished_spans()
|
||||
self.assertEqual(len(spans), 0)
|
||||
|
||||
@mock_lambda_deprecated
|
||||
def test_lambda_client(self):
|
||||
lamb = boto.awslambda.connect_to_region("us-east-2")
|
||||
|
Reference in New Issue
Block a user