diff options
| author | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-04-04 16:20:15 +0100 |
|---|---|---|
| committer | Gertjan van den Burg <gertjanvandenburg@gmail.com> | 2020-04-04 16:20:15 +0100 |
| commit | f24d1b3fdba482e69f7cfc7a6fb7ecabbcba069d (patch) | |
| tree | a76f9e7baefb0e0fc8a3e9662a2abc978744a915 /tests | |
| parent | Merge branch 'delaere-qpdfSwitch' (diff) | |
| download | paper2remarkable-f24d1b3fdba482e69f7cfc7a6fb7ecabbcba069d.tar.gz paper2remarkable-f24d1b3fdba482e69f7cfc7a6fb7ecabbcba069d.zip | |
Move arXiv tests to a separate file
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_arxiv.py | 29 | ||||
| -rw-r--r-- | tests/test_providers.py | 14 |
2 files changed, 29 insertions, 14 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() diff --git a/tests/test_providers.py b/tests/test_providers.py index e539949..e0239ed 100644 --- a/tests/test_providers.py +++ b/tests/test_providers.py @@ -7,7 +7,6 @@ __author__ = "G.J.J. van den Burg" import hashlib import os -import re import shutil import tempfile import unittest @@ -27,7 +26,6 @@ from paper2remarkable.providers import ( PubMed, Springer, ) -from paper2remarkable.providers.arxiv import DEARXIV_TEXT_REGEX VERBOSE = False @@ -43,18 +41,6 @@ def md5sum(filename): return hasher.hexdigest() -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) - - class TestProviders(unittest.TestCase): @classmethod def setUpClass(cls): |
