From 88c49fc4f4498a75cabe0cb58b81648084fb25da Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 May 2020 06:48:52 +0200 Subject: [PATCH] also check values --- python/tests/test_Result.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 6d1961823..92e61771f 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -92,9 +92,9 @@ class TestResult: default.pick('times',default.times_in_range(0,np.inf)[-1]) default.add_Cauchy() - dset = default.groups_with_datasets('sigma')[0]+'/sigma' + loc = default.get_dataset_location('sigma')[0] with h5py.File(default.fname,'r') as f: - created_first = f[dset].attrs['Created'].decode() + created_first = f[loc].attrs['Created'].decode() created_first = datetime.strptime(created_first,'%Y-%m-%d %H:%M:%S%z') if overwrite == 'on': @@ -103,14 +103,14 @@ class TestResult: default.disable_overwrite() time.sleep(2.) - default.add_Cauchy() + default.add_calculation('sigma','#sigma#*0.0+311.','not the Cauchy stress') with h5py.File(default.fname,'r') as f: - created_second = f[dset].attrs['Created'].decode() + created_second = f[loc].attrs['Created'].decode() created_second = datetime.strptime(created_second,'%Y-%m-%d %H:%M:%S%z') if overwrite == 'on': - assert created_first < created_second + assert created_first < created_second and np.allclose(default.read_dataset(loc),311.) else: - assert created_first == created_second + assert created_first == created_second and not np.allclose(default.read_dataset(loc),311.) def test_add_absolute(self,default): default.add_absolute('Fe')