Debian Codegraph @

test/dnsrec/test_algorithm.py

raw
1 # SPDX-License-Identifier: MPL-2.0
2
3 from test.common.classes import TestClasses
4
5 from cryptodatahub.common.algorithm import Authentication, Hash
6
7 from cryptodatahub.dnsrec.algorithm import SshFpAlgorithm, SshFpFingerprintType
8
9
10 class TestSshFpAlgorithm(TestClasses.TestJsonCodeNumericBase):
11 @classmethod
12 def _get_class(cls):
13 return SshFpAlgorithm
14
15 def test_name(self):
16 self.assertEqual(str(SshFpAlgorithm.RSA.value), 'RSA')
17
18 def test_algorithm(self):
19 self.assertEqual(SshFpAlgorithm.RSA.value.algorithm, Authentication.RSA)
20
21
22 class TestSshFpFingerprintType(TestClasses.TestJsonCodeNumericBase):
23 @classmethod
24 def _get_class(cls):
25 return SshFpFingerprintType
26
27 def test_name(self):
28 self.assertEqual(str(SshFpFingerprintType.SHA2_256.value), 'SHA-256')
29
30 def test_hash(self):
31 self.assertEqual(SshFpFingerprintType.SHA2_256.value.hash, Hash.SHA2_256)