aboutsummaryrefslogtreecommitdiff
path: root/tests/test_arxiv.py
diff options
context:
space:
mode:
authorGertjan van den Burg <gertjanvandenburg@gmail.com>2020-04-04 17:07:03 +0100
committerGertjan van den Burg <gertjanvandenburg@gmail.com>2020-04-04 17:07:03 +0100
commite6c8b5a2c0229ff8642bd3799f3e9d08d6fbf13a (patch)
tree192c77e548b1516ec83ccc81b6fa75f7722cf136 /tests/test_arxiv.py
parentMerge branch 'delaere-qpdfSwitch' (diff)
parentProperly update cookiejar (diff)
downloadpaper2remarkable-e6c8b5a2c0229ff8642bd3799f3e9d08d6fbf13a.tar.gz
paper2remarkable-e6c8b5a2c0229ff8642bd3799f3e9d08d6fbf13a.zip
Merge branch 'bugfix/springer_redirect'
Diffstat (limited to 'tests/test_arxiv.py')
-rw-r--r--tests/test_arxiv.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/test_arxiv.py b/tests/test_arxiv.py
new file mode 100644
index 0000000..beb9baa
--- /dev/null
+++ b/tests/test_arxiv.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+"""Unit tests for arXiv provider
+
+This file is part of paper2remarkable.
+
+"""
+
+import re
+import unittest
+
+from paper2remarkable.providers.arxiv import DEARXIV_TEXT_REGEX
+
+
+class TestArxiv(unittest.TestCase):
+ def test_text_regex_1(self):
+ key = b"arXiv:1908.03213v1 [astro.HE] 8 Aug 2019"
+ m = re.fullmatch(DEARXIV_TEXT_REGEX, key)
+ self.assertIsNotNone(m)
+
+ def test_text_regex_2(self):
+ key = b"arXiv:1908.03213v1 [astro-ph.HE] 8 Aug 2019"
+ m = re.fullmatch(DEARXIV_TEXT_REGEX, key)
+ self.assertIsNotNone(m)
+
+
+if __name__ == "__main__":
+ unittest.main()