def test_checkconfig_syntaxError_quiet(self):
     """
     When C{base.getConfigFileFromTac} raises L{SyntaxError},
     C{checkconfig.checkconfig} return an error.
     """
     mockGetConfig = mock.Mock(spec=base.getConfigFileFromTac, side_effect=SyntaxError)
     self.patch(checkconfig, "getConfigFileFromTac", mockGetConfig)
     config = dict(configFile=".", quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 1)
 def test_checkconfig_syntaxError_quiet(self):
     """
     When C{base.getConfigFileFromTac} raises L{SyntaxError},
     C{checkconfig.checkconfig} return an error.
     """
     mockGetConfig = mock.Mock(spec=base.getConfigFileFromTac,
                               side_effect=SyntaxError)
     self.patch(checkconfig, 'getConfigFileFromTac', mockGetConfig)
     config = dict(configFile='.', quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 1)
 def test_checkconfig_quiet(self):
     config = dict(configFile='master.cfg', quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.loadConfig.assert_called_with(basedir=os.getcwd(), configFile='master.cfg', quiet=True)
 def test_checkconfig_given_dir(self):
     self.assertEqual(checkconfig.checkconfig(dict(configFile='.')), 3)
     self.loadConfig.assert_called_with(basedir='.', configFile='master.cfg', quiet=None)
 def test_checkconfig_quiet(self):
     config = dict(configFile='master.cfg', quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.loadConfig.assert_called_with(basedir=os.getcwd(),
                                        configFile='master.cfg',
                                        quiet=True)
 def test_checkconfig_given_dir(self):
     self.assertEqual(checkconfig.checkconfig(dict(configFile='.')), 3)
     self.loadConfig.assert_called_with(basedir='.',
                                        configFile='master.cfg',
                                        quiet=None)
 def test_checkconfig_default(self):
     self.assertEqual(checkconfig.checkconfig(dict()), 3)
     self.loadConfig.assert_called_with(basedir=os.getcwd(),
                                        configFile='master.cfg',
                                        quiet=None)
Esempio n. 8
0
 def test_checkconfig_quiet(self):
     config = dict(configFile='master.cfg', quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.instance.load.assert_called_with(quiet=True)
Esempio n. 9
0
 def test_checkconfig_given_file(self):
     config = dict(configFile='master.cfg')
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.ConfigLoader.assert_called_with(configFileName='master.cfg')
     self.instance.load.assert_called_with(quiet=None)
Esempio n. 10
0
 def test_checkconfig_given_dir(self):
     self.assertEqual(checkconfig.checkconfig(dict(configFile='.')), 3)
     self.ConfigLoader.assert_called_with(basedir='.')
     self.instance.load.assert_called_with(quiet=None)
Esempio n. 11
0
 def test_checkconfig_default(self):
     self.assertEqual(checkconfig.checkconfig(dict()), 3)
     self.loadConfig.assert_called_with(basedir=os.getcwd(),
                                        configFile='master.cfg', quiet=None)
 def test_checkconfig_given_file(self):
     config = dict(configFile="master.cfg")
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.loadConfig.assert_called_with(basedir=os.getcwd(), configFile="master.cfg", quiet=None)
 def test_checkconfig_quiet(self):
     config = dict(configFile='master.cfg', quiet=True)
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.instance.load.assert_called_with(quiet=True)
 def test_checkconfig_given_file(self):
     config = dict(configFile='master.cfg')
     self.assertEqual(checkconfig.checkconfig(config), 3)
     self.ConfigLoader.assert_called_with(configFileName='master.cfg')
     self.instance.load.assert_called_with(quiet=None)
 def test_checkconfig_given_dir(self):
     self.assertEqual(checkconfig.checkconfig(dict(configFile='.')), 3)
     self.ConfigLoader.assert_called_with(basedir='.')
     self.instance.load.assert_called_with(quiet=None)