aboutsummaryrefslogtreecommitdiff
path: root/tests/test_arxiv.py
blob: beb9baa16b0a0a3603401b42ba7cbc739e05e9e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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()