def test_default_config(self): """Make sure that the -C option is set to the correct instance.""" instance_config_dir = os.path.join(self.config_root, 'instance1') os.mkdir(instance_config_dir) open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close() config.setInstance('instance1') self.assertEqual( ['-a_flag', '-C', '%s/launchpad.conf' % instance_config_dir], process_config_arguments(['-a_flag']))
def test_default_config(self): """Make sure that the -C option is set to the correct instance.""" instance_config_dir = os.path.join(self.config_root, 'instance1') os.mkdir(instance_config_dir) open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close() config.setInstance('instance1') self.assertEqual( ['-a_flag', '-C', '%s/launchpad.conf' % instance_config_dir], process_config_arguments(['-a_flag']))
def cleanUp(self): shutil.rmtree(self.config_root) lp.services.config.CONFIG_ROOT_DIRS = self.saved_config_roots config.setInstance(self.saved_instance)
def test_instance_not_found_raises_ValueError(self): """Make sure that an unknown instance fails.""" config.setInstance('unknown') self.assertRaises(ValueError, process_config_arguments, [])
def cleanUp(self): shutil.rmtree(self.config_root) lp.services.config.CONFIG_ROOT_DIRS = self.saved_config_roots config.setInstance(self.saved_instance)
def test_instance_not_found_raises_ValueError(self): """Make sure that an unknown instance fails.""" config.setInstance('unknown') self.assertRaises(ValueError, process_config_arguments, [])