diff options
author | Alexander Sulfrian <alexander@sulfrian.net> | 2017-03-10 17:55:11 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-10 17:55:11 +0100 |
commit | 9cba60eddee3e01830b0b0941e2b70b32bd9d4ed (patch) | |
tree | f159fbe3829d6aab6dd0daf82604bbc1c81e5a3a /testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py | |
parent | cc5fb876c005c443763f130f72acb1de0229efca (diff) | |
parent | d5e3fe95e8565b2c9af730473e4b25aecf5395c5 (diff) | |
download | bcfg2-9cba60eddee3e01830b0b0941e2b70b32bd9d4ed.tar.gz bcfg2-9cba60eddee3e01830b0b0941e2b70b32bd9d4ed.tar.bz2 bcfg2-9cba60eddee3e01830b0b0941e2b70b32bd9d4ed.zip |
Merge pull request #362 from AlexanderS/fix/missing-config-file
Options: Missing config file is not a fatal error
Diffstat (limited to 'testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py')
-rw-r--r-- | testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py b/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py index 78acadf1f..4277c8efe 100644 --- a/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py +++ b/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py @@ -45,6 +45,10 @@ class TestConfigFiles(OptionTestCase): inner1() @mock.patch("os.path.exists", mock.Mock(return_value=False)) - def test_no_config_file(self): + @make_config() + def test_no_config_file(self, config): """fail to read config file.""" - self.assertRaises(SystemExit, self.parser.parse, []) + try: + self.parser.parse(['-C', config]) + except SystemExit: + self.fail('Missing config file should not raise SystemExit') |