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']))
예제 #2
0
 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']))
예제 #3
0
 def test_i_sets_the_instance(self):
     """The -i parameter will set the config instance name."""
     instance_config_dir = os.path.join(self.config_root, 'test')
     os.mkdir(instance_config_dir)
     open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close()
     self.assertEqual(
         ['-o', 'foo', '-C',
          '%s/launchpad.conf' % instance_config_dir],
         process_config_arguments(['-i', 'test', '-o', 'foo']))
     self.assertEqual('test', config.instance_name)
 def test_i_sets_the_instance(self):
     """The -i parameter will set the config instance name."""
     instance_config_dir = os.path.join(self.config_root, 'test')
     os.mkdir(instance_config_dir)
     open(os.path.join(instance_config_dir, 'launchpad.conf'), 'w').close()
     self.assertEquals(
         ['-o', 'foo', '-C', '%s/launchpad.conf' % instance_config_dir],
         process_config_arguments(
             ['-i', 'test', '-o', 'foo']))
     self.assertEquals('test', config.instance_name)
예제 #5
0
 def test_keep_argument(self):
     """Make sure that a -C is processed unchanged."""
     self.assertEqual(['-v', '-C', 'a_file.conf', '-h'],
                      process_config_arguments(
                          ['-v', '-C', 'a_file.conf', '-h']))
 def test_keep_argument(self):
     """Make sure that a -C is processed unchanged."""
     self.assertEqual(
         ['-v', '-C', 'a_file.conf', '-h'],
         process_config_arguments(['-v', '-C', 'a_file.conf', '-h']))