mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-06-19 00:17:51 +02:00
add team-port.config and fix for blank values
This commit is contained in:
@ -1,7 +1,10 @@
|
||||
import unittest
|
||||
import os
|
||||
import re
|
||||
from typing import Generator
|
||||
import jc
|
||||
|
||||
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
|
||||
|
||||
class MyTests(unittest.TestCase):
|
||||
def test_jc_parse_csv(self):
|
||||
@ -40,5 +43,27 @@ class MyTests(unittest.TestCase):
|
||||
def test_jc_slurpable_parser_mod_list_is_list(self):
|
||||
self.assertIsInstance(jc.slurpable_parser_mod_list(), list)
|
||||
|
||||
def test_version_info(self):
|
||||
"""Test that the lib and pkg version strings match."""
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'jc/lib.py'), 'r', encoding='utf-8') as f:
|
||||
lib_file = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'setup.py'), 'r', encoding='utf-8') as f:
|
||||
pkg_file = f.read()
|
||||
|
||||
lib_pattern = re.compile(r'''__version__ = \'(?P<ver>\d+\.\d+\.\d+)\'''')
|
||||
pkg_pattern = re.compile(r''' version=\'(?P<ver>\d+\.\d+\.\d+)\'''')
|
||||
|
||||
lib_match = re.search(lib_pattern, lib_file)
|
||||
pkg_match = re.search(pkg_pattern, pkg_file)
|
||||
|
||||
if lib_match:
|
||||
lib_version = lib_match.groupdict()['ver']
|
||||
|
||||
if pkg_match:
|
||||
pkg_version = pkg_match.groupdict()['ver']
|
||||
|
||||
self.assertEqual(lib_version, pkg_version)
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
Reference in New Issue
Block a user