Tests for config in other file.

This commit is contained in:
Andrey Smirnov
2014-02-07 20:00:43 +04:00
parent 803570bf26
commit 14e66c03a6
6 changed files with 50 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ Test config file
"""
import os
import inspect
from lib import BaseTest
@@ -33,3 +34,20 @@ class BadConfigTest(BaseTest):
f = open(os.path.join(os.environ["HOME"], ".aptly.conf"), "w")
f.write("{some crap")
f.close()
class ConfigInFileTest(BaseTest):
"""
config in other file test
"""
runCmd = ["aptly", "-config=%s" % (os.path.join(os.path.dirname(inspect.getsourcefile(BadConfigTest)), "aptly.conf"), )]
prepare = BaseTest.prepare_remove_all
class ConfigInMissingFileTest(BaseTest):
"""
config in other file test
"""
runCmd = ["aptly", "-config=nosuchfile.conf"]
expectedCode = 1
prepare = BaseTest.prepare_remove_all