def test_pmid_init1(self): """ A pubmed uri doesn't work """ uri = 'http://www.ncbi.nlm.nih.gov/pubmed/24098140?dopt=abstract' doc = Document(pmid=uri) doc.update_from_pubmed() self.assertEqual([], list(doc.author()))
def test_pmid_init2(self): """ A pubmed id """ pmid = "24098140" doc = Document(pmid=pmid) doc.update_from_pubmed() self.assertIn(u'Frédéric MY', list(doc.author()))
def test_pubmed_init1(self): """ A pubmed uri """ uri = 'http://www.ncbi.nlm.nih.gov/pubmed/24098140?dopt=abstract' doc = Document(pubmed=uri) doc.update_from_pubmed() self.assertIn(u'Frédéric MY', list(doc.author()))
def test_pubmed_multiple_authors_list(self): """ When multiple authors are on a paper, all of their names should be returned in an iterator. Publication order not necessarily preserved """ pmid = "24098140" alist = [ u"Frédéric MY", "Lundin VF", "Whiteside MD", "Cueva JG", "Tu DK", "Kang SY", "Singh H", "Baillie DL", "Hutter H", "Goodman MB", "Brinkman FS", "Leroux MR" ] doc = Document(pmid=pmid) doc.update_from_pubmed() self.assertEqual(set(alist), set(doc.author()))
def test_pubmed_multiple_authors_list(self): """ When multiple authors are on a paper, all of their names should be returned in an iterator. Publication order not necessarily preserved """ pmid = "24098140" alist = [ u"Frédéric MY", "Lundin VF", "Whiteside MD", "Cueva JG", "Tu DK", "Kang SY", "Singh H", "Baillie DL", "Hutter H", "Goodman MB", "Brinkman FS", "Leroux MR"] doc = Document(pmid=pmid) doc.update_from_pubmed() self.assertEqual(set(alist), set(doc.author()))