Exemplo n.º 1
0
 def test_cfg_path7(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     util.set_config_base_dir('etc/occo', prefix=False)
     self.assertEqual(util.cfg_file_path('alma'),
                      os.path.join(os.getcwd(), 'etc/occo/alma'))
Exemplo n.º 2
0
 def test_cfg_path7(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     util.set_config_base_dir('etc/occo', prefix=False)
     self.assertEqual(util.cfg_file_path('alma'),
                      os.path.join(os.getcwd(), 'etc/occo/alma'))
Exemplo n.º 3
0
 def test_import_from_string(self):
     import yaml
     util.set_config_base_dir(util.rel_to_file('import_test'), prefix=False)
     self.control_filename = util.rel_to_file(
         'import_test/control_text.yaml')
     data = yaml.load("""
                      nothing: 0
                      child1: !text_import
                          url: file://c1_text.yaml
                      """)
     control = cfg.yaml_load_file(self.control_filename)
     self.assertEqual(data, control)
Exemplo n.º 4
0
 def test_import_from_string(self):
     import yaml
     util.set_config_base_dir(util.rel_to_file('import_test'),
                              prefix=False)
     self.control_filename = util.rel_to_file('import_test/control_text.yaml')
     data = yaml.load("""
                      nothing: 0
                      child1: !text_import
                          url: file://c1_text.yaml
                      """)
     control = cfg.yaml_load_file(self.control_filename)
     self.assertEqual(data, control)
Exemplo n.º 5
0
 def test_cfg_path6(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('/etc/occo/alma', 'anyth:ng'),
                      sys.prefix + '/etc/occo/alma')
Exemplo n.º 6
0
 def test_cfg_path4(self):
     import sys, os
     util.set_config_base_dir('/etc/occo')
     self.assertEqual(util.cfg_file_path('alma', '/etc/occo2'),
                      '/etc/occo2/alma')
Exemplo n.º 7
0
 def test_cfg_path3(self):
     import sys, os
     util.set_config_base_dir('/etc/occo', prefix=False)
     self.assertEqual(util.cfg_file_path('alma'),
                      '/etc/occo/alma')
Exemplo n.º 8
0
 def test_cfg_path2(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('alma', '/etc/occo'),
                      os.path.join('/etc/occo', 'alma'))
Exemplo n.º 9
0
 def test_cfg_path1(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('alma'),
                      os.path.join(os.getcwd(), 'alma'))
Exemplo n.º 10
0
 def test_cfg_path5(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('/etc/occo/alma'),
                      sys.prefix + '/etc/occo/alma')
Exemplo n.º 11
0
 def test_cfg_path4(self):
     import sys, os
     util.set_config_base_dir('/etc/occo')
     self.assertEqual(util.cfg_file_path('alma', '/etc/occo2'),
                      '/etc/occo2/alma')
Exemplo n.º 12
0
 def test_cfg_path3(self):
     import sys, os
     util.set_config_base_dir('/etc/occo', prefix=False)
     self.assertEqual(util.cfg_file_path('alma'), '/etc/occo/alma')
Exemplo n.º 13
0
 def test_cfg_path2(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('alma', '/etc/occo'),
                      os.path.join('/etc/occo', 'alma'))
Exemplo n.º 14
0
 def test_cfg_path1(self):
     import sys, os
     # Reset config path
     util.set_config_base_dir(None)
     self.assertEqual(util.cfg_file_path('alma'),
                      os.path.join(os.getcwd(), 'alma'))