| Conditions | 6 |
| Total Lines | 16 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | import os |
||
| 16 | def test_SetWriter(root_dir, reference_data): |
||
| 17 | |||
| 18 | for name in reference_data: |
||
| 19 | refs = reference_data[name] |
||
| 20 | |||
| 21 | path = os.path.join(root_dir, rf'{name}_TEMP.hdf5') |
||
| 22 | |||
| 23 | with amd.SetWriter(path) as writer: |
||
| 24 | writer.iwrite(refs) |
||
| 25 | |||
| 26 | with amd.SetReader(path) as reader_: |
||
| 27 | for s, s_ in zip(refs, reader_): |
||
| 28 | if not s == s_: |
||
| 29 | pytest.fail(f'Structure {s_.name} written with SetWriter disagrees with reference') |
||
| 30 | |||
| 31 | os.remove(path) |
||
| 32 |