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()
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:
writer.SetCompressorTypeToZLib()

View File

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