mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-04-19 19:28:22 +00:00
swagger: add test
This commit is contained in:
@@ -33,7 +33,8 @@ class APITest(BaseTest):
|
||||
"rootDir": f"{os.environ['HOME']}/{BaseTest.aptlyDir}/apiandserve",
|
||||
"linkMethod": "symlink"
|
||||
}
|
||||
}
|
||||
},
|
||||
"enableSwaggerEndpoint": True
|
||||
}
|
||||
|
||||
def fixture_available(self):
|
||||
|
||||
17
system/t12_api/docs.py
Normal file
17
system/t12_api/docs.py
Normal file
@@ -0,0 +1,17 @@
|
||||
from api_lib import APITest
|
||||
|
||||
|
||||
class TaskAPITestSwaggerDocs(APITest):
|
||||
"""
|
||||
GET /docs
|
||||
"""
|
||||
|
||||
def check(self):
|
||||
resp = self.get("/docs/doc.json")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
|
||||
resp = self.get("/docs/", allow_redirects=False)
|
||||
self.check_equal(resp.status_code, 301)
|
||||
|
||||
resp = self.get("/docs/index.html")
|
||||
self.check_equal(resp.status_code, 200)
|
||||
Reference in New Issue
Block a user