Exemplo n.º 1
0
 def testDataDirFromConfig(self):
     """
     When settings.ini is present, honor the values coming from it.
     """
     stg = settings.Settings(self.config_file.name)
     # Trick the module to think we're on a system wide install
     stg.intree = False
     flexmock(settings, settings=stg)
     from avocado.core import data_dir
     flexmock(data_dir, settings=stg)
     self.assertFalse(data_dir.settings.intree)
     reload(data_dir)
     for key in self.mapping.keys():
         data_dir_func = getattr(data_dir, 'get_%s' % key)
         self.assertEqual(data_dir_func(), stg.get_value('runner', key))
     del data_dir
Exemplo n.º 2
0
 def setUp(self):
     self.config_file = tempfile.NamedTemporaryFile(delete=False)
     self.config_file.write(example_1)
     self.config_file.close()
     self.settings = settings.Settings(self.config_file.name)