TestVersion.test_version_format()   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 8
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
cc 1
nop 1
1
#!/usr/bin/python
2
# -*- coding: utf-8 -*-
3
import re
4
import unittest
5
6
from saucenao import __version__ as saucenao_version
7
8
9
class TestVersion(unittest.TestCase):
10
    """Test the version information for Python PEP standard"""
11
12
    def test_version_format(self):
13
        """Test the version number for a PyPi valid format according to PEP 440
14
        https://www.python.org/dev/peps/pep-0440/
15
16
        :return:
17
        """
18
        # ToDo: check all requirements
19
        self.assertEqual(bool(re.match(r'\d+.\d+', saucenao_version.__version__)), True)
20
21
22
if __name__ == '__main__':
23
    suite = unittest.TestLoader().loadTestsFromTestCase(TestVersion)
24
    unittest.TextTestRunner(verbosity=2).run(suite)
25