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')
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')
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')
def test_err_invalid_ext(self): # Test for invalid file extension: exception = includehandler.LoadConfigException with pytest.raises(exception): includehandler.load_config('x.xyz')
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')
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')
def test_err_invalid_ext(self): # Test for invalid file extension: exception = includehandler.LoadConfigException with pytest.raises(exception): includehandler.load_config('x.xyz')
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')