mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-01-12 03:21:33 +00:00
Add snapshots API test suite
This commit is contained in:
@@ -47,6 +47,14 @@ class APITest(BaseTest):
|
||||
kwargs["headers"]["Content-Type"] = "application/json"
|
||||
return requests.post("http://%s%s" % (self.base_url, uri), *args, **kwargs)
|
||||
|
||||
def put(self, uri, *args, **kwargs):
|
||||
if "json" in kwargs:
|
||||
kwargs["data"] = json.dumps(kwargs.pop("json"))
|
||||
if not "headers" in kwargs:
|
||||
kwargs["headers"] = {}
|
||||
kwargs["headers"]["Content-Type"] = "application/json"
|
||||
return requests.put("http://%s%s" % (self.base_url, uri), *args, **kwargs)
|
||||
|
||||
def delete(self, uri, *args, **kwargs):
|
||||
if "json" in kwargs:
|
||||
kwargs["data"] = json.dumps(kwargs.pop("json"))
|
||||
|
||||
Reference in New Issue
Block a user