def test_conversion_to_respecth(self, filename_ck):
"""Test proper conversion to ReSpecTh XML.
"""
file_path = os.path.join(filename_ck)
filename = pkg_resources.resource_filename(__name__, file_path)
c_true = ChemKED(filename)
with TemporaryDirectory() as temp_dir:
newfile = os.path.join(temp_dir, 'test.xml')
c_true.convert_to_ReSpecTh(newfile)
with pytest.warns(UserWarning) as record:
c = ChemKED.from_respecth(newfile)
m = str(record.pop(UserWarning).message)
assert m == 'Using DOI to obtain reference information, rather than preferredKey.'
assert c.file_authors[0]['name'] == c_true.file_authors[0]['name']
assert c.reference.detail == 'Converted from ReSpecTh XML file {}'.format(os.path.split(newfile)[1])
assert c.apparatus.kind == c_true.apparatus.kind
assert c.experiment_type == c_true.experiment_type
assert c.reference.doi == c_true.reference.doi
assert len(c.datapoints) == len(c_true.datapoints)
评论列表
文章目录