mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2025-07-15 01:24:29 +02:00
add osx uname tests
This commit is contained in:
1
tests/fixtures/osx-10.11.6/uname-a.json
vendored
Normal file
1
tests/fixtures/osx-10.11.6/uname-a.json
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"machine": "x86_64", "kernel_name": "Darwin", "node_name": "Kellys-Air.attlocal.net", "kernel_release": "15.6.0", "kernel_version": "Darwin Kernel Version 15.6.0: Thu Jun 21 20:07:40 PDT 2018; root:xnu-3248.73.11~1/RELEASE_X86_64"}
|
1
tests/fixtures/osx-10.14.6/uname-a.json
vendored
Normal file
1
tests/fixtures/osx-10.14.6/uname-a.json
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
{"machine": "x86_64", "kernel_name": "Darwin", "node_name": "kbrazil-mac", "kernel_release": "18.7.0", "kernel_version": "Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64"}
|
2
tests/fixtures/osx-10.14.6/uname-a.out
vendored
2
tests/fixtures/osx-10.14.6/uname-a.out
vendored
@ -1 +1 @@
|
|||||||
Darwin Kellys-MBP.attlocal.net 18.7.0 Darwin Kernel Version 18.7.0: Sat Oct 12 00:02:19 PDT 2019; root:xnu-4903.278.12~1/RELEASE_X86_64 x86_64
|
Darwin kbrazil-mac 18.7.0 Darwin Kernel Version 18.7.0: Sun Dec 1 18:59:03 PST 2019; root:xnu-4903.278.19~1/RELEASE_X86_64 x86_64
|
||||||
|
@ -16,6 +16,12 @@ class MyTests(unittest.TestCase):
|
|||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/uname-a.out'), 'r') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/uname-a.out'), 'r') as f:
|
||||||
self.ubuntu_18_4_uname_a = f.read()
|
self.ubuntu_18_4_uname_a = f.read()
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.11.6/uname-a.out'), 'r') as f:
|
||||||
|
self.osx_10_11_6_uname_a = f.read()
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/uname-a.out'), 'r') as f:
|
||||||
|
self.osx_10_14_6_uname_a = f.read()
|
||||||
|
|
||||||
# output
|
# output
|
||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/uname-a.json'), 'r') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/uname-a.json'), 'r') as f:
|
||||||
self.centos_7_7_uname_a_json = json.loads(f.read())
|
self.centos_7_7_uname_a_json = json.loads(f.read())
|
||||||
@ -23,6 +29,12 @@ class MyTests(unittest.TestCase):
|
|||||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/uname-a.json'), 'r') as f:
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-18.04/uname-a.json'), 'r') as f:
|
||||||
self.ubuntu_18_4_uname_a_json = json.loads(f.read())
|
self.ubuntu_18_4_uname_a_json = json.loads(f.read())
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.11.6/uname-a.json'), 'r') as f:
|
||||||
|
self.osx_10_11_6_uname_a_json = json.loads(f.read())
|
||||||
|
|
||||||
|
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/uname-a.json'), 'r') as f:
|
||||||
|
self.osx_10_14_6_uname_a_json = json.loads(f.read())
|
||||||
|
|
||||||
def test_uname_centos_7_7(self):
|
def test_uname_centos_7_7(self):
|
||||||
"""
|
"""
|
||||||
Test 'uname -a' on Centos 7.7
|
Test 'uname -a' on Centos 7.7
|
||||||
@ -35,6 +47,18 @@ class MyTests(unittest.TestCase):
|
|||||||
"""
|
"""
|
||||||
self.assertEqual(jc.parsers.uname.parse(self.ubuntu_18_4_uname_a, quiet=True), self.ubuntu_18_4_uname_a_json)
|
self.assertEqual(jc.parsers.uname.parse(self.ubuntu_18_4_uname_a, quiet=True), self.ubuntu_18_4_uname_a_json)
|
||||||
|
|
||||||
|
def test_uname_osx_10_11_6(self):
|
||||||
|
"""
|
||||||
|
Test 'uname -a' on OSX 10.11.6
|
||||||
|
"""
|
||||||
|
self.assertEqual(jc.parsers.uname.parse(self.osx_10_11_6_uname_a, quiet=True), self.osx_10_11_6_uname_a_json)
|
||||||
|
|
||||||
|
def test_uname_osx_10_14_6(self):
|
||||||
|
"""
|
||||||
|
Test 'uname -a' on OSX 10.14.6
|
||||||
|
"""
|
||||||
|
self.assertEqual(jc.parsers.uname.parse(self.osx_10_14_6_uname_a, quiet=True), self.osx_10_14_6_uname_a_json)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
unittest.main()
|
unittest.main()
|
||||||
|
Reference in New Issue
Block a user