From ba26168e6d5fe5ed7aaf341e17cddad4a18bd58d Mon Sep 17 00:00:00 2001 From: glide-the <2533736852@qq.com> Date: Tue, 21 May 2024 14:58:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/integration_tests/test_batches.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tests/integration_tests/test_batches.py b/tests/integration_tests/test_batches.py index a2de54f..ffb0a29 100644 --- a/tests/integration_tests/test_batches.py +++ b/tests/integration_tests/test_batches.py @@ -87,12 +87,13 @@ def test_batch_list(logging_conf) -> None: try: list = client.batches.list(limit=10) print(list) - print("_________get_next_page___________") - batch = list.get_next_page() - print(batch) - print("_________iter_pages___________") - for batch in list.iter_pages(): + if list.has_more: + print("_________get_next_page___________") + batch = list.get_next_page() print(batch) + print("_________iter_pages___________") + for batch in list.iter_pages(): + print(batch) except zhipuai.core._errors.APIRequestFailedError as err: print(err) except zhipuai.core._errors.APIInternalError as err: