예제 #1
0
    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")
예제 #2
0
 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 + "'")
예제 #3
0
 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))