From 5ad7fe04d0ac1436670a4bd871a7621b75af793a Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Tue, 26 May 2020 07:15:27 +0200 Subject: [PATCH] bugfix: used wrong type --- python/tests/test_Result.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/python/tests/test_Result.py b/python/tests/test_Result.py index 772cf4734..11395b23f 100644 --- a/python/tests/test_Result.py +++ b/python/tests/test_Result.py @@ -271,9 +271,10 @@ class TestResult: default.pick('times',default.times_in_range(0,np.inf)[-1]) default.add_Cauchy() - loc = default.get_dataset_location('sigma')[0] + loc = default.get_dataset_location('sigma') + print(loc) with h5py.File(default.fname,'r') as f: - created_first = f[loc].attrs['Created'].decode() + created_first = f[loc[0]].attrs['Created'].decode() created_first = datetime.strptime(created_first,'%Y-%m-%d %H:%M:%S%z') if overwrite == 'on': @@ -284,7 +285,7 @@ class TestResult: time.sleep(2.) default.add_calculation('sigma','#sigma#*0.0+311.','not the Cauchy stress') with h5py.File(default.fname,'r') as f: - created_second = f[loc].attrs['Created'].decode() + created_second = f[loc[0]].attrs['Created'].decode() created_second = datetime.strptime(created_second,'%Y-%m-%d %H:%M:%S%z') if overwrite == 'on': assert created_first < created_second and np.allclose(default.read_dataset(loc),311.)