예제 #1
0
 def test_header_valid(self):
     testvector = [
         'header: {version: 4}',
         'header: {version: 5}',
         ]
     for string in testvector:
         with patch_open(includehandler, string=string):
             includehandler.load_config('x.yml')
예제 #2
0
 def test_header_valid(self):
     testvector = [
         'header: {version: 4}',
         'header: {version: 5}',
     ]
     for string in testvector:
         with patch_open(includehandler, string=string):
             includehandler.load_config('x.yml')
예제 #3
0
 def util_exception_content(self, testvector):
     for string, exception in testvector:
         with patch_open(includehandler, string=string):
             with pytest.raises(exception):
                 includehandler.load_config('x.yml')
예제 #4
0
 def test_err_invalid_ext(self):
     # Test for invalid file extension:
     exception = includehandler.LoadConfigException
     with pytest.raises(exception):
         includehandler.load_config('x.xyz')
예제 #5
0
 def test_compat_version(self, monkeypatch):
     monkeypatch.setattr(includehandler, '__compatible_file_version__', 1)
     with patch_open(includehandler, string='header: {version: "0.10"}'):
         includehandler.load_config('x.yml')
예제 #6
0
 def util_exception_content(self, testvector):
     for string, exception in testvector:
         with patch_open(includehandler, string=string):
             with pytest.raises(exception):
                 includehandler.load_config('x.yml')
예제 #7
0
 def test_err_invalid_ext(self):
     # Test for invalid file extension:
     exception = includehandler.LoadConfigException
     with pytest.raises(exception):
         includehandler.load_config('x.xyz')
예제 #8
0
 def test_compat_version(self, monkeypatch):
     monkeypatch.setattr(includehandler, '__compatible_file_version__', 1)
     with patch_open(includehandler, string='header: {version: "0.10"}'):
         includehandler.load_config('x.yml')