test more

This commit is contained in:
Martin Diehl 2021-08-18 11:17:13 +02:00
parent 5a2cd83186
commit 041d3ffdd7
5 changed files with 15 additions and 3 deletions

View File

@ -1 +1 @@
eb506713032481aebf870b965eaca8b5 6fb37bd65934de859dd6b6e0191e7d64

View File

@ -0,0 +1 @@
bb783bb80ff04dd435e814f4b82a3234

View File

@ -0,0 +1 @@
ba97286c5d95bf817143f7bb9cf58421

View File

@ -1,10 +1,20 @@
import pytest import pytest
import numpy as np import numpy as np
import damask
from damask import Crystal from damask import Crystal
class TestCrystal: class TestCrystal:
@pytest.mark.parametrize('lattice,family',[('aP','cubic'),('xI','cubic')])
def test_invalid_init(self,lattice,family):
with pytest.raises(KeyError):
Crystal(family=family,lattice=lattice)
def test_eq(self):
family = np.random.choice(list(damask._crystal.lattice_symmetries.values()))
assert Crystal(family=family) == Crystal(family=family)
def test_double_to_lattice(self): def test_double_to_lattice(self):
c = Crystal(lattice='cF') c = Crystal(lattice='cF')
with pytest.raises(KeyError): with pytest.raises(KeyError):
@ -55,3 +65,4 @@ class TestCrystal:
alpha=alpha,beta=beta,gamma=gamma) alpha=alpha,beta=beta,gamma=gamma)
assert np.allclose(vector, assert np.allclose(vector,
c.to_frame(**{keyFrame:c.to_lattice(**{keyLattice:vector})})) c.to_frame(**{keyFrame:c.to_lattice(**{keyLattice:vector})}))

View File

@ -369,8 +369,7 @@ class TestResult:
b = default.coordinates0_node.reshape(tuple(default.cells+1)+(3,),order='F') b = default.coordinates0_node.reshape(tuple(default.cells+1)+(3,),order='F')
assert np.allclose(a,b) assert np.allclose(a,b)
# need to wait for writing in parallel, output order might change if select more than one @pytest.mark.parametrize('output',['F','*',['P'],['P','F']],ids=range(4))
@pytest.mark.parametrize('output',['F','*',['P']],ids=range(3))
@pytest.mark.parametrize('fname',['12grains6x7x8_tensionY.hdf5'],ids=range(1)) @pytest.mark.parametrize('fname',['12grains6x7x8_tensionY.hdf5'],ids=range(1))
@pytest.mark.parametrize('inc',[4,0],ids=range(2)) @pytest.mark.parametrize('inc',[4,0],ids=range(2))
def test_vtk(self,request,tmp_path,ref_path,update,patch_execution_stamp,patch_datetime_now,output,fname,inc): def test_vtk(self,request,tmp_path,ref_path,update,patch_execution_stamp,patch_datetime_now,output,fname,inc):