improve api tests and error output

show only relevant aptly logs if a test fails.
for async tasks, show task output, as it contains the error message.
This commit is contained in:
André Roth
2024-07-16 19:48:04 +02:00
parent 8029305d32
commit 440c3debdc
11 changed files with 278 additions and 175 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ import urllib.error
import urllib.parse
import urllib.request
from api_lib import TASK_SUCCEEDED, APITest
from api_lib import APITest
class PackagesAPITestShow(APITest):
@@ -19,7 +19,7 @@ class PackagesAPITestShow(APITest):
"pyspi_0.6.1-1.3.dsc", "pyspi_0.6.1-1.3.diff.gz", "pyspi_0.6.1.orig.tar.gz").status_code, 200)
resp = self.post_task("/api/repos/" + repo_name + "/file/" + d)
self.check_equal(resp.json()['State'], TASK_SUCCEEDED)
self.check_task(resp)
# get information about package
pyspi_json = {