コード例 #1
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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'))
コード例 #2
0
ファイル: general_tests.py プロジェクト: occopus/util
 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'))
コード例 #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)
コード例 #4
0
ファイル: config_test.py プロジェクト: novakadam94/util
 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)
コード例 #5
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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')
コード例 #6
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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')
コード例 #7
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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')
コード例 #8
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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'))
コード例 #9
0
ファイル: general_tests.py プロジェクト: novakadam94/util
 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'))
コード例 #10
0
ファイル: general_tests.py プロジェクト: occopus/util
 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')
コード例 #11
0
ファイル: general_tests.py プロジェクト: occopus/util
 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')
コード例 #12
0
ファイル: general_tests.py プロジェクト: occopus/util
 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')
コード例 #13
0
ファイル: general_tests.py プロジェクト: occopus/util
 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'))
コード例 #14
0
ファイル: general_tests.py プロジェクト: occopus/util
 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'))