increased test coverage
This commit is contained in:
parent
4a5e5d8451
commit
c5f284cd8d
|
@ -1258,7 +1258,7 @@ class Result:
|
||||||
Arguments parsed to func.
|
Arguments parsed to func.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if len(datasets) != 1 or self.N_constituents !=1:
|
if len(datasets) != 1 or self.N_constituents != 1:
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
at_cell_ph,in_data_ph,at_cell_ho,in_data_ho = self._mappings()
|
at_cell_ph,in_data_ph,at_cell_ho,in_data_ho = self._mappings()
|
||||||
|
|
|
@ -268,10 +268,15 @@ class TestResult:
|
||||||
in_file = default.place('V(F)')
|
in_file = default.place('V(F)')
|
||||||
assert np.allclose(in_memory,in_file)
|
assert np.allclose(in_memory,in_file)
|
||||||
|
|
||||||
def test_add_invalid(self,default):
|
def test_add_invalid_dataset(self,default):
|
||||||
with pytest.raises(TypeError):
|
with pytest.raises(TypeError):
|
||||||
default.add_calculation('#invalid#*2')
|
default.add_calculation('#invalid#*2')
|
||||||
|
|
||||||
|
def test_add_generic_grid_invalid(self,ref_path):
|
||||||
|
result = Result(ref_path/'4grains2x4x3_compressionY.hdf5')
|
||||||
|
with pytest.raises(NotImplementedError):
|
||||||
|
result.add_curl('F')
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('shape',['vector','tensor'])
|
@pytest.mark.parametrize('shape',['vector','tensor'])
|
||||||
def test_add_curl(self,default,shape):
|
def test_add_curl(self,default,shape):
|
||||||
|
@ -502,7 +507,10 @@ class TestResult:
|
||||||
|
|
||||||
@pytest.mark.parametrize('fname',['4grains2x4x3_compressionY.hdf5',
|
@pytest.mark.parametrize('fname',['4grains2x4x3_compressionY.hdf5',
|
||||||
'6grains6x7x8_single_phase_tensionY.hdf5'])
|
'6grains6x7x8_single_phase_tensionY.hdf5'])
|
||||||
def test_export_setup(self,ref_path,tmp_path,fname):
|
@pytest.mark.parametrize('output',['material.yaml','*'])
|
||||||
|
@pytest.mark.parametrize('overwrite',[True,False])
|
||||||
|
def test_export_setup(self,ref_path,tmp_path,fname,output,overwrite):
|
||||||
os.chdir(tmp_path)
|
os.chdir(tmp_path)
|
||||||
r = Result(ref_path/fname)
|
r = Result(ref_path/fname)
|
||||||
r.export_setup()
|
r.export_setup(output,overwrite)
|
||||||
|
r.export_setup(output,overwrite)
|
||||||
|
|
Loading…
Reference in New Issue