Conditions | 6 |
Total Lines | 15 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import pytest |
||
10 | def test_CSDReader(reference_data, refcode_families): |
||
11 | |||
12 | if not amd.io._CSD_PYTHON_API_ENABLED: |
||
13 | pytest.skip(f'Skipping CSDReader test as csd-python-api is not installed.') |
||
14 | |||
15 | references = reference_data['CSD_families'] |
||
16 | read_in = list(amd.CSDReader(refcode_families, show_warnings=False, families=True)) |
||
17 | |||
18 | if (not len(references) == len(read_in)) or len(read_in) == 0: |
||
19 | pytest.fail(f'There are {len(references)} references, but {len(read_in)} structures were read.') |
||
20 | |||
21 | for s, s_ in zip(read_in, references): |
||
22 | print(s, s_) |
||
23 | if not s == s_: |
||
24 | pytest.fail(f'Structure {s.name} is different from reference.') |
||
25 |