Spaces:
Sleeping
Sleeping
Commit
·
e203fb5
1
Parent(s):
e5ddac0
added unittests for class
Browse files- test/test.py +15 -9
test/test.py
CHANGED
@@ -7,19 +7,25 @@ import shutil
|
|
7 |
|
8 |
|
9 |
class Utils(unittest.TestCase):
|
10 |
-
def test_download_pdf(self):
|
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 |
-
|
|
|
|
|
|
|
22 |
self.assertEqual(pdf_info, str(test_pdf_info[0]))
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
if __name__ == '__main__':
|
25 |
unittest.main()
|
|
|
7 |
|
8 |
|
9 |
class Utils(unittest.TestCase):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10 |
def test_arXiv_API(self):
|
11 |
search_query = 'Tools for Landscape Analysis of Optimisation Problems in Procedural Content Generation for Games'
|
12 |
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).')"
|
13 |
+
max_results = 1
|
14 |
+
XRxiv_servers = ['rxiv']
|
15 |
+
search_engines = XRxivQuery(search_query, max_results, XRxiv_servers=XRxiv_servers)
|
16 |
+
test_pdf_info = search_engines.call_API()
|
17 |
self.assertEqual(pdf_info, str(test_pdf_info[0]))
|
18 |
|
19 |
+
def test_download_pdf(self):
|
20 |
+
search_query = 'Serverless Applications: Why, When, and How?'
|
21 |
+
max_results = 1
|
22 |
+
XRxiv_servers = ['rxiv']
|
23 |
+
search_engines = XRxivQuery(search_query, max_results, XRxiv_servers=XRxiv_servers)
|
24 |
+
test_pdf_info = search_engines.call_API()
|
25 |
+
search_engines.download_pdf()
|
26 |
+
dowloaded_dir = 'docs/Serverless Applications Why When and How .pdf'
|
27 |
+
self.assertTrue(os.path.exists(dowloaded_dir))
|
28 |
+
shutil.rmtree(f'docs/')
|
29 |
+
|
30 |
if __name__ == '__main__':
|
31 |
unittest.main()
|