def test_empty_url(self): result = { '_journal_name_full': '', '_journal_page_first': '', '_journal_year': '', '_publ_author_name': [], '_publ_section_title': '' } self.assertEqual(result, resolve_doi(''))
def test_invalid_url(self): result = { '_journal_name_full': '', '_journal_page_first': '', '_journal_year': '', '_publ_author_name': [], '_publ_section_title': '' } self.assertEqual(result, resolve_doi('http://doi.org/10.1021/ic00090a02'))
def get_doi_data(self): citation = resolve_doi(self.ui.publication_doi_lineedit.text()) self.ui.DOIResolveTextLabel.clear() status = False for key, value in citation.items(): if not value: continue if key == '_publ_author_name': value = delimit_string(value[0]) self.ui.DOIResolveTextLabel.setText( self.ui.DOIResolveTextLabel.text() + "{}:\t {}\n".format(key, value)) self.cif.set_pair_delimited(key, value) status = True if not status: self.ui.DOIResolveTextLabel.setText( "Failed to get DOI information!")
def test_resolve_doi_online(self): result = { '_journal_name_full': 'Inorganic Chemistry', '_publ_author_name': ['Le Bail, A.', 'Marcos, M. D.', 'Amoros, P.'], '_journal_page_first': '2607', '_publ_section_title': 'Ab Initio Crystal Structure Determination of ' 'VO(H2PO2)2.cntdot.H2O from X-ray and Neutron Powder ' 'Diffraction Data. A Monodimensional Vanadium(IV) ' 'Hypophosphite', '_journal_year': '1994' } self.assertEqual(result, resolve_doi('http://doi.org/10.1021/ic00090a021'))
def setUp(self) -> None: self.doi = resolve_doi('10.1107/S1600576718004508') pprint(self.doi)