Ejemplo n.º 1
0
 def test_vtk(self, request, tmp_path, ref_path, update,
              patch_execution_stamp, patch_datetime_now, output, fname,
              inc):
     result = Result(ref_path / fname).view('increments', inc)
     os.chdir(tmp_path)
     result.save_VTK(output)
     fname = fname.split(
         '.')[0] + f'_inc{(inc if type(inc) == int else inc[0]):0>2}.vtr'
     last = ''
     for i in range(10):
         if os.path.isfile(tmp_path / fname):
             with open(fname) as f:
                 cur = hashlib.md5(f.read().encode()).hexdigest()
                 if cur == last:
                     break
                 else:
                     last = cur
         time.sleep(.5)
     if update:
         with open((ref_path / 'save_VTK' /
                    request.node.name).with_suffix('.md5'), 'w') as f:
             f.write(cur)
     with open((ref_path / 'save_VTK' /
                request.node.name).with_suffix('.md5')) as f:
         assert cur == f.read()
Ejemplo n.º 2
0
 def test_vtk_marc(self, tmp_path, ref_path, mode, output):
     os.chdir(tmp_path)
     result = Result(ref_path / 'check_compile_job1.hdf5')
     result.save_VTK(output, mode)