1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-10-08 23:22:21 +02:00

add utf-8 encoding for testing on Windows

This commit is contained in:
Kelly Brazil
2020-03-04 19:47:03 -08:00
parent f48e229202
commit b2c872925b
20 changed files with 208 additions and 220 deletions

View File

@@ -10,25 +10,13 @@ class MyTests(unittest.TestCase):
def setUp(self):
# input
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/systemctl-lj.out'), 'r') as f:
# self.centos_7_7_systemctl_lj = f.read()
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/systemctl-lj.out'), 'r') as f:
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/systemctl-lj.out'), 'r', encoding='utf-8') as f:
self.ubuntu_18_4_systemctl_lj = f.read()
# output
# with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/systemctl-lj.json'), 'r') as f:
# self.centos_7_7_systemctl_lj_json = json.loads(f.read())
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/systemctl-lj.json'), 'r') as f:
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/systemctl-lj.json'), 'r', encoding='utf-8') as f:
self.ubuntu_18_4_systemctl_lj_json = json.loads(f.read())
# def test_systemctl_lj_centos_7_7(self):
# """
# Test 'systemctl -a list-jobs' on Centos 7.7
# """
# self.assertEqual(jc.parsers.systemctl_lj.parse(self.centos_7_7_systemctl_lj, quiet=True), self.centos_7_7_systemctl_lj_json)
def test_systemctl_lj_ubuntu_18_4(self):
"""
Test 'systemctl -a list-jobs' on Ubuntu 18.4