コード例 #1
0
 def test_citation_helper(self):
     with self.app.test_request_context('/bibutils'):
         expected = [{'author': 'x_author', 'bibcode': 'x', 'score': 2, 'title': 'x_title'}, 
                     {'author': 'z_author', 'bibcode': 'z', 'score': 2, 'title': 'z_title'}]
         self.useFixture(ReferenceDataFixture())
         self.useFixture(CitationDataFixture())
         self.useFixture(MetaDataFixture())
         self.assertEqual(biblio_functions.get_suggestions(bibcodes=['a','b','c']),expected)
コード例 #2
0
 def test_empty_input(self):
     with self.app.test_request_context('/bibutils'):
         self.app.preprocess_request()
         self.assertEqual(biblio_functions.get_suggestions(), [])