correct order (brackets)

This commit is contained in:
Martin Diehl 2020-11-05 21:38:00 +01:00
parent 68d384bbdd
commit 30938a8278
2 changed files with 5 additions and 4 deletions

View File

@ -199,7 +199,7 @@ class VTK:
default_ext = '.'+writer.GetDefaultFileExtension() default_ext = '.'+writer.GetDefaultFileExtension()
ext = Path(fname).suffix ext = Path(fname).suffix
writer.SetFileName(str(fname)+default_ext if default_ext != ext else '') writer.SetFileName(str(fname)+(default_ext if default_ext != ext else ''))
if compress: if compress:
writer.SetCompressorTypeToZLib() writer.SetCompressorTypeToZLib()

View File

@ -98,9 +98,10 @@ class TestVTK:
with pytest.raises(TypeError): with pytest.raises(TypeError):
VTK.load(name,dataset_type) VTK.load(name,dataset_type)
def test_invalid_extension_write(self,default): def test_add_extension(self,tmp_path,default):
with pytest.raises(ValueError): default.save(tmp_path/'default.txt',parallel=False)
default.save('default.txt') assert os.path.isfile(tmp_path/'default.txt.vtr')
def test_invalid_get(self,default): def test_invalid_get(self,default):
with pytest.raises(ValueError): with pytest.raises(ValueError):