From 897b615fa0500344bd13396ec6304dd74d60dcbe Mon Sep 17 00:00:00 2001 From: skywalker Date: Wed, 15 May 2024 18:00:48 +0800 Subject: [PATCH] 12.0 test ApiTestBase --- .github/workflows/test.yml | 1 + tests/api/apitestbase.py | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 915184a2dff..53b2fe7b697 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -40,3 +40,4 @@ jobs: cd $GITHUB_WORKSPACE export CCNET_CONF_DIR=/tmp/ccnet SEAFILE_CONF_DIR=/tmp/seafile-data TRAVIS=1 if ./tests/test_seahub_changes.sh; then ./tests/seahubtests.sh init && ./tests/seahubtests.sh runserver && ./tests/seahubtests.sh test; else true; fi + cat /tmp/logs/seahub.access.log diff --git a/tests/api/apitestbase.py b/tests/api/apitestbase.py index 1272d8f62d3..3d5db836928 100644 --- a/tests/api/apitestbase.py +++ b/tests/api/apitestbase.py @@ -84,12 +84,12 @@ def _req(cls, method, *args, **kwargs): if expected is not None: if hasattr(expected, '__iter__'): assert_in(resp.status_code, expected, - "Expected http status in %s, received %s" % (expected, - resp.status_code)) + "Expected http status in %s, received %s, %s, %s" % (expected, + resp.status_code, resp.text, args)) else: assert_equal(resp.status_code, expected, - "Expected http status %s, received %s" % (expected, - resp.status_code)) + "Expected http status %s, received %s, %s, %s" % (expected, + resp.status_code, resp.text, args)) return resp def assertHasLen(self, lst, length):