cubicweb/test/unittest_cwconfig.py
changeset 11476 a9f26de5ea6c
parent 11472 bc04039acd2e
child 11478 1817f8946c22
equal deleted inserted replaced
11475:d2fcd81b7ca9 11476:a9f26de5ea6c
   201         if sys.modules.pop('cubes.file', None) and PY3:
   201         if sys.modules.pop('cubes.file', None) and PY3:
   202             del cubes.file
   202             del cubes.file
   203         from cubes import file
   203         from cubes import file
   204         self.assertEqual(file.__path__, [join(self.custom_cubes_dir, 'file')])
   204         self.assertEqual(file.__path__, [join(self.custom_cubes_dir, 'file')])
   205 
   205 
       
   206     def test_config_value_from_environment(self):
       
   207         self.assertIsNone(self.config['base-url'])
       
   208         os.environ['CW_BASE_URL'] = 'https://www.cubicweb.org'
       
   209         try:
       
   210             self.assertEqual(self.config['base-url'],
       
   211                              'https://www.cubicweb.org')
       
   212         finally:
       
   213             del os.environ['CW_BASE_URL']
       
   214 
   206 
   215 
   207 class FindPrefixTC(unittest.TestCase):
   216 class FindPrefixTC(unittest.TestCase):
   208     def make_dirs(self, *args):
   217     def make_dirs(self, *args):
   209         path = join(tempfile.tempdir, *args)
   218         path = join(tempfile.tempdir, *args)
   210         if not os.path.exists(path):
   219         if not os.path.exists(path):