Simple tests for graph generation API. #169

This commit is contained in:
Andrey Smirnov
2015-01-13 22:15:06 +03:00
parent 2816647809
commit a0d7ae28bf
3 changed files with 20 additions and 2 deletions
+2 -1
View File
@@ -5,4 +5,5 @@ Testing aptly REST API
from .repos import *
from .files import *
from .publish import *
from .version import *
from .version import *
from .graph import *
+17
View File
@@ -0,0 +1,17 @@
from api_lib import APITest
class GraphAPITest(APITest):
"""
GET /graph.:ext
"""
def check(self):
resp = self.get("/api/graph.png")
self.check_equal(resp.headers["Content-Type"], "image/png")
self.check_equal(resp.content[:4], '\x89PNG')
self.check_equal(self.post("/api/repos", json={"Name": "xyz", "Comment": "fun repo"}).status_code, 201)
resp = self.get("/api/graph.svg")
self.check_equal(resp.headers["Content-Type"], "image/svg+xml")
self.check_equal(resp.content[:4], '<?xm')
+1 -1
View File
@@ -45,7 +45,7 @@ class PublishAPITestRepo(APITest):
'Storage': ''})
class PublishSnapshotAPITestRepo(APITest):
class PublishSnapshotAPITest(APITest):
"""
POST /publish/:prefix/snapshot