def test_parses_to_bibtex(self): bib = doi2bibtex('10.1007/BF01700692') b = self.endecoder.decode_bibdata(bib) self.assertEqual(len(b), 1) entry = b[list(b)[0]] self.assertEqual(entry['author'][0], 'Gödel, Kurt') self.assertEqual(entry['title'], 'Über formal unentscheidbare Sätze der Principia ' 'Mathematica und verwandter Systeme I')
def test_parse_fails_on_incorrect_ISBN(self): bib = doi2bibtex('9' * 13) with self.assertRaises(ValueError): self.endecoder.decode_bibdata(bib)
def test_unicode(self): bib = doi2bibtex('10.1007/BF01700692') self.assertIsInstance(bib, ustr) self.assertIn('Kurt Gödel', bib)
def test_parse_fails_on_incorrect_DOI(self): bib = doi2bibtex('999999') with self.assertRaises(EnDecoder.BibDecodingError): self.endecoder.decode_bibdata(bib)
def test_readme(self, reqget): apis.doi2bibtex('10.1007/s00422-012-0514-6') apis.isbn2bibtex('978-0822324669') apis.arxiv2bibtex('math/9501234')
def test_unicode(self, reqget): bib = apis.doi2bibtex('10.1007/BF01700692') self.assertIsInstance(bib, ustr) self.assertIn('Kurt Gödel', bib)