Add system's requirements.txt, enforce flake8 linter

Fix style issues in functional tests.
This commit is contained in:
Andrey Smirnov
2017-04-27 18:58:15 +03:00
parent 7a7b981d4f
commit c798db8056
44 changed files with 334 additions and 260 deletions
+56 -18
View File
@@ -5,9 +5,17 @@ import inspect
import re
from lib import BaseTest
gpgRemove = lambda _, s: re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
changesRemove = lambda _, s: s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
tempDirRemove = lambda self, s: s.replace(self.tempSrcDir, "")
def gpgRemove(_, s):
return re.sub(r'Signature made .* using|gpgv: keyblock resource .*$|gpgv: Can\'t check signature: .*$', '', s, flags=re.MULTILINE)
def changesRemove(_, s):
return s.replace(os.path.join(os.path.dirname(inspect.getsourcefile(BaseTest)), "changes"), "")
def tempDirRemove(self, s):
return s.replace(self.tempSrcDir, "")
class IncludeRepo1Test(BaseTest):
@@ -59,7 +67,9 @@ class IncludeRepo3Test(BaseTest):
]
runCmd = "aptly repo include -no-remove-files -keyring=${files}/aptly.pub -repo=my-{{.Distribution} ${changes}"
expectedCode = 1
outputMatchPrepare = lambda _, s: s.replace('; missing space?', '')
def outputMatchPrepare(_, s):
return s.replace('; missing space?', '')
class IncludeRepo4Test(BaseTest):
@@ -126,9 +136,11 @@ class IncludeRepo6Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo6Test, self).prepare()
@@ -161,9 +173,11 @@ class IncludeRepo7Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo7Test, self).prepare()
@@ -191,9 +205,11 @@ class IncludeRepo8Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo8Test, self).prepare()
@@ -224,9 +240,11 @@ class IncludeRepo9Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo9Test, self).prepare()
@@ -258,7 +276,9 @@ class IncludeRepo10Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -ignore-signatures "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo10Test, self).prepare()
@@ -290,7 +310,9 @@ class IncludeRepo11Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -accept-unsigned -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo11Test, self).prepare()
@@ -323,9 +345,11 @@ class IncludeRepo12Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -accept-unsigned -keyring=${files}/aptly.pub "
outputMatchPrepare = lambda self, s: gpgRemove(self, tempDirRemove(self, s))
expectedCode = 1
def outputMatchPrepare(self, s):
return gpgRemove(self, tempDirRemove(self, s))
def prepare(self):
super(IncludeRepo12Test, self).prepare()
@@ -358,9 +382,11 @@ class IncludeRepo13Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders1.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
expectedCode = 1
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo14Test(BaseTest):
"""
@@ -370,7 +396,9 @@ class IncludeRepo14Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders2.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo15Test(BaseTest):
@@ -381,9 +409,11 @@ class IncludeRepo15Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders-404.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
expectedCode = 1
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo16Test(BaseTest):
"""
@@ -393,9 +423,11 @@ class IncludeRepo16Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders3.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
expectedCode = 1
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo17Test(BaseTest):
"""
@@ -405,9 +437,11 @@ class IncludeRepo17Test(BaseTest):
"aptly repo create unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders4.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
expectedCode = 1
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo18Test(BaseTest):
"""
@@ -417,7 +451,9 @@ class IncludeRepo18Test(BaseTest):
"aptly repo create -uploaders-file=${changes}/uploaders2.json unstable",
]
runCmd = "aptly repo include -uploaders-file=${changes}/uploaders1.json -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))
class IncludeRepo19Test(BaseTest):
@@ -428,5 +464,7 @@ class IncludeRepo19Test(BaseTest):
"aptly repo create -uploaders-file=${changes}/uploaders1.json unstable",
]
runCmd = "aptly repo include -no-remove-files -keyring=${files}/aptly.pub ${changes}"
outputMatchPrepare = lambda _, s: changesRemove(_, gpgRemove(_, s))
expectedCode = 1
def outputMatchPrepare(_, s):
return changesRemove(_, gpgRemove(_, s))