Rework fatal mechanism, open config on demand.

This commit is contained in:
Andrey Smirnov
2014-04-06 21:05:06 +04:00
parent 3db7125932
commit 83b2e0250d
4 changed files with 63 additions and 98 deletions

View File

@@ -12,7 +12,7 @@ class CreateConfigTest(BaseTest):
"""
new file is generated if missing
"""
runCmd = "aptly"
runCmd = "aptly mirror list"
checkedFile = os.path.join(os.environ["HOME"], ".aptly.conf")
check = BaseTest.check_file
@@ -24,7 +24,7 @@ class BadConfigTest(BaseTest):
"""
broken config file
"""
runCmd = "aptly"
runCmd = "aptly mirror list"
expectedCode = 1
gold_processor = BaseTest.expand_environ
@@ -41,7 +41,8 @@ class ConfigInFileTest(BaseTest):
"""
config in other file test
"""
runCmd = ["aptly", "-config=%s" % (os.path.join(os.path.dirname(inspect.getsourcefile(BadConfigTest)), "aptly.conf"), )]
runCmd = ["aptly", "mirror", "list",
"-config=%s" % (os.path.join(os.path.dirname(inspect.getsourcefile(BadConfigTest)), "aptly.conf"), )]
prepare = BaseTest.prepare_remove_all
outputMatchPrepare = lambda _, s: re.sub(r' -(cpuprofile|memprofile|memstats|meminterval)=.*\n', '', s, flags=re.MULTILINE)
@@ -51,6 +52,6 @@ class ConfigInMissingFileTest(BaseTest):
"""
config in other file test
"""
runCmd = ["aptly", "-config=nosuchfile.conf"]
runCmd = ["aptly", "mirror", "list", "-config=nosuchfile.conf"]
expectedCode = 1
prepare = BaseTest.prepare_remove_all