mehradans92 commited on
Commit
b06418a
·
1 Parent(s): 64cac75

added unittest for arxiv api

Browse files
Files changed (1) hide show
  1. test/test.py +9 -1
test/test.py CHANGED
@@ -11,7 +11,15 @@ class Utils(unittest.TestCase):
11
  pdf_info = [('Serverless Applications Why When and How ', 'http://arxiv.org/pdf/2009.08173v2', ['Simon Eismann', 'Joel Scheuner', 'Erwin van Eyk', 'Maximilian Schwinger', 'Johannes Grohmann', 'Cristina L. Abad', 'Alexandru Iosup'], ['cs.SE', 'cs.DC', 'D.2.11; D.2.0; D.2.1'], 'docs', 'Simon Eismann, Joel Scheuner, Erwin van Eyk, Maximilian Schwinger, Johannes Grohmann, Cristina L. Abad, Alexandru Iosup, Serverless Applications Why When and How . arXiv [cs.SE] (2020), (available at http://arxiv.org/pdf/2009.08173v2).')]
12
  download_pdf(pdf_info)
13
  dowloaded_dir = 'docs/Serverless Applications Why When and How .pdf'
14
- assert os.path.exists(dowloaded_dir) == True
15
  shutil.rmtree(f'docs/')
 
 
 
 
 
 
 
 
16
  if __name__ == '__main__':
17
  unittest.main()
 
11
  pdf_info = [('Serverless Applications Why When and How ', 'http://arxiv.org/pdf/2009.08173v2', ['Simon Eismann', 'Joel Scheuner', 'Erwin van Eyk', 'Maximilian Schwinger', 'Johannes Grohmann', 'Cristina L. Abad', 'Alexandru Iosup'], ['cs.SE', 'cs.DC', 'D.2.11; D.2.0; D.2.1'], 'docs', 'Simon Eismann, Joel Scheuner, Erwin van Eyk, Maximilian Schwinger, Johannes Grohmann, Cristina L. Abad, Alexandru Iosup, Serverless Applications Why When and How . arXiv [cs.SE] (2020), (available at http://arxiv.org/pdf/2009.08173v2).')]
12
  download_pdf(pdf_info)
13
  dowloaded_dir = 'docs/Serverless Applications Why When and How .pdf'
14
+ self.assertTrue(os.path.exists(dowloaded_dir))
15
  shutil.rmtree(f'docs/')
16
+
17
+
18
+ def test_arXiv_API(self):
19
+ search_query = 'Tools for Landscape Analysis of Optimisation Problems in Procedural Content Generation for Games'
20
+ pdf_info = "('Tools for Landscape Analysis of Optimisation Problems in Procedural Content Generation for Games', 'http://arxiv.org/pdf/2302.08479v1', ['Vanessa Volz', 'Boris Naujoks', 'Pascal Kerschke', 'Tea Tusar'], ['cs.AI'], 'docs', 'Vanessa Volz, Boris Naujoks, Pascal Kerschke, Tea Tusar, Tools for Landscape Analysis of Optimisation Problems in Procedural Content Generation for Games. arXiv [cs.AI] (2023), (available at http://arxiv.org/pdf/2302.08479v1).')"
21
+ test_pdf_info, test_pdf_citation = call_arXiv_API(search_query, max_results='1')
22
+ self.assertEqual(pdf_info, str(test_pdf_info[0]))
23
+
24
  if __name__ == '__main__':
25
  unittest.main()