mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-02 04:50:49 +00:00
Improvement: Remove Magic Numbers in Tests with Tasks
Replaced 2 with TASK_SUCCEEDED, 3 with TASK_FAILED. fixes: #1158
This commit is contained in:
committed by
Benj Fassbind
parent
5b5307cc15
commit
90932cdac5
@@ -1,4 +1,4 @@
|
||||
from api_lib import APITest
|
||||
from api_lib import TASK_SUCCEEDED, APITest
|
||||
|
||||
|
||||
class MirrorsAPITestCreateShow(APITest):
|
||||
@@ -56,7 +56,7 @@ class MirrorsAPITestCreateUpdate(APITest):
|
||||
|
||||
mirror_desc["Name"] = self.random_name()
|
||||
resp = self.put_task("/api/mirrors/" + mirror_name, json=mirror_desc)
|
||||
self.check_equal(resp.json()["State"], 2)
|
||||
self.check_equal(resp.json()["State"], TASK_SUCCEEDED)
|
||||
|
||||
_id = resp.json()['ID']
|
||||
resp = self.get("/api/tasks/" + str(_id) + "/detail")
|
||||
@@ -90,7 +90,7 @@ class MirrorsAPITestCreateDelete(APITest):
|
||||
self.check_equal(resp.status_code, 201)
|
||||
|
||||
resp = self.delete_task("/api/mirrors/" + mirror_name)
|
||||
self.check_equal(resp.json()['State'], 2)
|
||||
self.check_equal(resp.json()['State'], TASK_SUCCEEDED)
|
||||
|
||||
|
||||
class MirrorsAPITestCreateList(APITest):
|
||||
|
||||
Reference in New Issue
Block a user