@@ 50-67 (lines=18) @@ | ||
47 | self.assertEqual(ts, SnmpAuthAlgorithm.MD5) |
|
48 | ||
49 | ||
50 | class GetSnmpPrivacyAlgorithmFromStringTestCase(unittest.TestCase): |
|
51 | def test_invalid_status(self): |
|
52 | with self.assertRaises(InvalidArgument): |
|
53 | get_snmp_privacy_algorithm_from_string('foo') |
|
54 | ||
55 | def test_none_or_empty_type(self): |
|
56 | ts = get_snmp_privacy_algorithm_from_string(None) |
|
57 | self.assertIsNone(ts) |
|
58 | ts = get_snmp_privacy_algorithm_from_string('') |
|
59 | self.assertIsNone(ts) |
|
60 | ||
61 | def test_aes(self): |
|
62 | ts = get_snmp_privacy_algorithm_from_string('aes') |
|
63 | self.assertEqual(ts, SnmpPrivacyAlgorithm.AES) |
|
64 | ||
65 | def test_des(self): |
|
66 | ts = get_snmp_privacy_algorithm_from_string('des') |
|
67 | self.assertEqual(ts, SnmpPrivacyAlgorithm.DES) |
|
68 |
@@ 50-67 (lines=18) @@ | ||
47 | self.assertEqual(ts, SnmpAuthAlgorithm.MD5) |
|
48 | ||
49 | ||
50 | class GetSnmpPrivacyAlgorithmFromStringTestCase(unittest.TestCase): |
|
51 | def test_invalid_status(self): |
|
52 | with self.assertRaises(InvalidArgument): |
|
53 | get_snmp_privacy_algorithm_from_string('foo') |
|
54 | ||
55 | def test_none_or_empty_type(self): |
|
56 | ts = get_snmp_privacy_algorithm_from_string(None) |
|
57 | self.assertIsNone(ts) |
|
58 | ts = get_snmp_privacy_algorithm_from_string('') |
|
59 | self.assertIsNone(ts) |
|
60 | ||
61 | def test_aes(self): |
|
62 | ts = get_snmp_privacy_algorithm_from_string('aes') |
|
63 | self.assertEqual(ts, SnmpPrivacyAlgorithm.AES) |
|
64 | ||
65 | def test_des(self): |
|
66 | ts = get_snmp_privacy_algorithm_from_string('des') |
|
67 | self.assertEqual(ts, SnmpPrivacyAlgorithm.DES) |
|
68 |