def testInvalidServer(self):
"""Test download on non-existent server"""
spec = { 'url' : "https://127.1.2.3:7257" }
archive = SimpleHttpArchive(spec)
archive.wantDownload(True)
archive.wantUpload(True)
# Local
archive.downloadPackage(b'\x00'*20, "unused", "unused", 0)
archive.downloadPackage(b'\x00'*20, "unused", "unused", 1)
self.assertEqual(archive.downloadLocalLiveBuildId(b'\x00'*20, 0), None)
# Jenkins
with TemporaryDirectory() as workspace:
with open(os.path.join(workspace, "test.buildid"), "wb") as f:
f.write(b'\x00'*20)
script = archive.download(None, "test.buildid", "result.tgz")
callJenkinsScript(script, workspace)
评论列表
文章目录