From d849362b8fcbe43bc32111b20df3022272dd48a5 Mon Sep 17 00:00:00 2001 From: Richard Marmorstein Date: Mon, 20 Nov 2023 16:47:00 -0800 Subject: [PATCH] Add integration test --- tests/test_integration.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/test_integration.py b/tests/test_integration.py index 3fdcf6b48..ec647debc 100644 --- a/tests/test_integration.py +++ b/tests/test_integration.py @@ -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 @@ -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