testing new functionality
This commit is contained in:
parent
f6de182eb6
commit
be11da2284
|
@ -42,6 +42,10 @@ class TestGrid:
|
||||||
print('patched datetime.datetime.now')
|
print('patched datetime.datetime.now')
|
||||||
|
|
||||||
|
|
||||||
|
def test_show(sef,default,monkeypatch):
|
||||||
|
monkeypatch.delenv('DISPLAY',raising=False)
|
||||||
|
default.show()
|
||||||
|
|
||||||
def test_equal(self,default):
|
def test_equal(self,default):
|
||||||
assert default == default
|
assert default == default
|
||||||
assert not default == 42
|
assert not default == 42
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import os
|
import os
|
||||||
import filecmp
|
import filecmp
|
||||||
import time
|
import time
|
||||||
|
import string
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
@ -173,6 +174,22 @@ class TestVTK:
|
||||||
assert str(mask_manual) == str(mask_auto)
|
assert str(mask_manual) == str(mask_auto)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize('data_type,shape',[(float,(3,)),
|
||||||
|
(float,(3,3)),
|
||||||
|
(float,(1,)),
|
||||||
|
(int,(4,)),
|
||||||
|
(str,(1,))])
|
||||||
|
@pytest.mark.parametrize('N_values',[5*6*7,6*7*8])
|
||||||
|
def test_labels(self,default,data_type,shape,N_values):
|
||||||
|
data = np.squeeze(np.random.randint(0,100,(N_values,)+shape)).astype(data_type)
|
||||||
|
ALPHABET = np.array(list(string.ascii_lowercase + ' '))
|
||||||
|
label = ''.join(np.random.choice(ALPHABET, size=10))
|
||||||
|
new = default.add(data,label)
|
||||||
|
if N_values == default.N_points: assert label in new.labels['Point Data']
|
||||||
|
if N_values == default.N_cells: assert label in new.labels['Cell Data']
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_comments(self,tmp_path,default):
|
def test_comments(self,tmp_path,default):
|
||||||
default.comments += 'this is a comment'
|
default.comments += 'this is a comment'
|
||||||
default.save(tmp_path/'with_comments',parallel=False)
|
default.save(tmp_path/'with_comments',parallel=False)
|
||||||
|
|
Loading…
Reference in New Issue