mirror of
https://github.com/kellyjonbrazil/jc.git
synced 2026-04-24 20:56:11 +02:00
Add tests for other mode indicators
This commit is contained in:
+1
@@ -0,0 +1 @@
|
||||
[{"filename": "openssl-3.6.0.tar.gz", "mode": "*", "hash": "b6a5f44b7eb69e3fa35dbf15524405b44837a481d43d81daddde3ff21fcbb8e9"}]
|
||||
+1
@@ -0,0 +1 @@
|
||||
b6a5f44b7eb69e3fa35dbf15524405b44837a481d43d81daddde3ff21fcbb8e9 *openssl-3.6.0.tar.gz
|
||||
+1
@@ -0,0 +1 @@
|
||||
[{"filename": "out.txt", "mode": "U", "hash": "6fe4d572948d4c132d1b1b0ab91e89de4be01efd"}, {"filename": "out.txt", "mode": "^", "hash": "68382a729a930a2219f0bd10c5c4d61eec856a96"}]
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
6fe4d572948d4c132d1b1b0ab91e89de4be01efd Uout.txt
|
||||
68382a729a930a2219f0bd10c5c4d61eec856a96 ^out.txt
|
||||
@@ -18,6 +18,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.out'), 'r', encoding='utf-8') as f:
|
||||
centos_7_7_sha384sum = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.out'), 'r', encoding='utf-8') as f:
|
||||
ubuntu_24_04_sha256sum = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.out'), 'r', encoding='utf-8') as f:
|
||||
ubuntu_24_04_shasum = f.read()
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/md5.out'), 'r', encoding='utf-8') as f:
|
||||
osx_10_14_6_md5 = f.read()
|
||||
|
||||
@@ -34,6 +40,12 @@ class MyTests(unittest.TestCase):
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/centos-7.7/sha384sum.json'), 'r', encoding='utf-8') as f:
|
||||
centos_7_7_sha384sum_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-24.04/sha256sum.json'), 'r', encoding='utf-8') as f:
|
||||
ubuntu_24_04_sha256sum_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/ubuntu-24.04/shasum.json'), 'r', encoding='utf-8') as f:
|
||||
ubuntu_24_04_shasum_json = json.loads(f.read())
|
||||
|
||||
with open(os.path.join(THIS_DIR, os.pardir, 'tests/fixtures/osx-10.14.6/md5.json'), 'r', encoding='utf-8') as f:
|
||||
osx_10_14_6_md5_json = json.loads(f.read())
|
||||
|
||||
@@ -65,6 +77,18 @@ class MyTests(unittest.TestCase):
|
||||
"""
|
||||
self.assertEqual(jc.parsers.hashsum.parse(self.centos_7_7_sha384sum, quiet=True), self.centos_7_7_sha384sum_json)
|
||||
|
||||
def test_sha256sum_ubuntu_24_04(self):
|
||||
"""
|
||||
Test 'sha256sum' on Ubuntu 24.04
|
||||
"""
|
||||
self.assertEqual(jc.parsers.hashsum.parse(self.ubuntu_24_04_sha256sum, quiet=True), self.ubuntu_24_04_sha256sum_json)
|
||||
|
||||
def test_shasum_ubuntu_24_04(self):
|
||||
"""
|
||||
Test 'shasum' on Ubuntu 24.04
|
||||
"""
|
||||
self.assertEqual(jc.parsers.hashsum.parse(self.ubuntu_24_04_shasum, quiet=True), self.ubuntu_24_04_shasum_json)
|
||||
|
||||
def test_md5_osx_10_14_6(self):
|
||||
"""
|
||||
Test 'md5' on OSX 10.14.6
|
||||
|
||||
Reference in New Issue
Block a user