mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
implement system tests for serving api and published repos simultaneously
This commit is contained in:
committed by
Benj Fassbind
parent
e25ade8af3
commit
f74217ed9c
+12
-3
@@ -24,6 +24,14 @@ class APITest(BaseTest):
|
||||
"""
|
||||
aptly_server = None
|
||||
base_url = "127.0.0.1:8765"
|
||||
configOverride = {
|
||||
"FileSystemPublishEndpoints": {
|
||||
"apiandserve": {
|
||||
"rootDir": f"{os.environ['HOME']}/{BaseTest.aptlyDir}/apiandserve",
|
||||
"linkMethod": "symlink"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
def fixture_available(self):
|
||||
return super(APITest, self).fixture_available() and requests is not None
|
||||
@@ -32,11 +40,12 @@ class APITest(BaseTest):
|
||||
if APITest.aptly_server is None:
|
||||
super(APITest, self).prepare()
|
||||
|
||||
APITest.aptly_server = self._start_process("aptly api serve -no-lock -listen=%s" % (self.base_url),)
|
||||
configPath = os.path.join(os.environ["HOME"], self.aptlyConfigFile)
|
||||
APITest.aptly_server = self._start_process(f"aptly api serve -no-lock -config={configPath} -listen={self.base_url}",)
|
||||
time.sleep(1)
|
||||
|
||||
if os.path.exists(os.path.join(os.environ["HOME"], ".aptly", "upload")):
|
||||
shutil.rmtree(os.path.join(os.environ["HOME"], ".aptly", "upload"))
|
||||
if os.path.exists(os.path.join(os.environ["HOME"], self.aptlyDir, "upload")):
|
||||
shutil.rmtree(os.path.join(os.environ["HOME"], self.aptlyDir, "upload"))
|
||||
|
||||
def run(self):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user