From 1e6213e5fdff5f8146c00af8a76cb1ebf68fcac5 Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Wed, 15 Oct 2014 12:41:31 -0700 Subject: Test failure to parse config file when bcfg2.conf exists --- testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py') diff --git a/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py b/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py index aee2ff666..78acadf1f 100644 --- a/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py +++ b/testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py @@ -2,9 +2,10 @@ import argparse +import mock + from Bcfg2.Options import Option, PathOption, ConfigFileAction, get_parser, \ new_parser - from testsuite.Testsrc.Testlib.TestOptions import make_config, OptionTestCase @@ -43,6 +44,7 @@ class TestConfigFiles(OptionTestCase): inner1() + @mock.patch("os.path.exists", mock.Mock(return_value=False)) def test_no_config_file(self): """fail to read config file.""" self.assertRaises(SystemExit, self.parser.parse, []) -- cgit v1.2.3-1-g7c22