summaryrefslogtreecommitdiffstats
path: root/testsuite
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2014-10-15 12:41:31 -0700
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2014-11-10 17:35:43 -0600
commit1e6213e5fdff5f8146c00af8a76cb1ebf68fcac5 (patch)
treefbfa2b39e433c5b4f7c60ad9683e6a928e420c81 /testsuite
parent5ceb76e562dc5aedae08910f65c2ff7cdf0c9ac1 (diff)
downloadbcfg2-1e6213e5fdff5f8146c00af8a76cb1ebf68fcac5.tar.gz
bcfg2-1e6213e5fdff5f8146c00af8a76cb1ebf68fcac5.tar.bz2
bcfg2-1e6213e5fdff5f8146c00af8a76cb1ebf68fcac5.zip
Test failure to parse config file when bcfg2.conf exists
Diffstat (limited to 'testsuite')
-rw-r--r--testsuite/Testsrc/Testlib/TestOptions/TestConfigFiles.py4
-rw-r--r--testsuite/Testsrc/Testlib/TestOptions/__init__.py6
2 files changed, 3 insertions, 7 deletions
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, [])
diff --git a/testsuite/Testsrc/Testlib/TestOptions/__init__.py b/testsuite/Testsrc/Testlib/TestOptions/__init__.py
index b051f65e5..00e250356 100644
--- a/testsuite/Testsrc/Testlib/TestOptions/__init__.py
+++ b/testsuite/Testsrc/Testlib/TestOptions/__init__.py
@@ -77,9 +77,3 @@ class OptionTestCase(Bcfg2TestCase):
@classmethod
def tearDownClass(cls):
Parser.unit_test = True
-
-
-
-# TODO:
-# * subcommands
-# * common options