def test_missing_doi_period_at_end(self):
"""Ensure can handle missing DOI with period at end of reference.
"""
root = etree.Element('experiment')
ref = etree.SubElement(root, 'bibliographyLink')
ref.set('preferredKey', 'Chaumeix, N., Pichon, S., Lafosse, F., Paillard, C.-E., '
'International Journal of Hydrogen Energy, 2007, (32) 2216-2226, '
'Fig. 12., right, open diamond.'
)
with pytest.warns(UserWarning) as record:
ref = get_reference(root)
m = str(record.pop(UserWarning).message)
assert m == ('Missing doi attribute in bibliographyLink. Setting "detail" key as a '
'fallback; please update to the appropriate fields.')
assert ref['detail'] == ('Chaumeix, N., Pichon, S., Lafosse, F., Paillard, C.-E., '
'International Journal of Hydrogen Energy, 2007, (32) 2216-2226, '
'Fig. 12., right, open diamond.'
)
评论列表
文章目录