Skip to content

Commit

Permalink
Add integration test
Browse files Browse the repository at this point in the history
  • Loading branch information
richardm-stripe committed Dec 1, 2023
1 parent 59b7558 commit d849362
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,11 @@ def do_request(self, req_num):
stripe.api_base = "http://localhost:%s" % self.mock_server_port
stripe.enable_telemetry = True

stripe.Balance.retrieve()
stripe.Balance.retrieve()
cus = stripe.Customer("cus_xyz")
cus.description = "hello"
cus.save()

stripe.Customer.retrieve("cus_xyz")

reqs = MockServerRequestHandler.get_requests(2)
assert MockServerRequestHandler.num_requests == 2
Expand All @@ -202,6 +205,9 @@ def do_request(self, req_num):
# latency shouldn't be outside this range.
assert 30 < duration_ms < 300

usage = telemetry["last_request_metrics"]["usage"]
assert usage == ["save"]

def test_uses_thread_local_client_telemetry(self):
class MockServerRequestHandler(TestHandler):
local_num_requests = 0
Expand Down

0 comments on commit d849362

Please sign in to comment.