def test_paper(self): result = PubMed.read_papers_from_ids([25929677]) self.assertEquals(len(result[0][u'MedlineCitation'][u'Article'][u'AuthorList']), 7, "25929677 should have 7 authors")
def _query_min_results(self, query, min=0): """Tests given query, ensures at least min results are found""" result = PubMed.get_ids_from_query(query) self.assertGreater(len(result), 0, "Expected at lest " + str(min) + " results for query '" + query + "'")
def test_query(self): result = int(PubMed.get_data_from_query("smoking")[u'Count']) min_ = 25000 self.assertGreater(result, min_, "Expected >%d results for smoking, got %d" % (min_, result))