Code Duplication    Length = 18-18 lines in 2 locations

tests/protocols/gmpv208/enums/test_snmp_algorithms.py 1 location

@@ 30-47 (lines=18) @@
27
)
28
29
30
class GetSnmpAuthAlgorithmFromStringTestCase(unittest.TestCase):
31
    def test_invalid_status(self):
32
        with self.assertRaises(InvalidArgument):
33
            get_snmp_auth_algorithm_from_string('foo')
34
35
    def test_none_or_empty_type(self):
36
        ts = get_snmp_auth_algorithm_from_string(None)
37
        self.assertIsNone(ts)
38
        ts = get_snmp_auth_algorithm_from_string('')
39
        self.assertIsNone(ts)
40
41
    def test_sha1(self):
42
        ts = get_snmp_auth_algorithm_from_string('sha1')
43
        self.assertEqual(ts, SnmpAuthAlgorithm.SHA1)
44
45
    def test_md5(self):
46
        ts = get_snmp_auth_algorithm_from_string('md5')
47
        self.assertEqual(ts, SnmpAuthAlgorithm.MD5)
48
49
50
class GetSnmpPrivacyAlgorithmFromStringTestCase(unittest.TestCase):

tests/protocols/gmpv214/enums/test_snmp_algorithms.py 1 location

@@ 30-47 (lines=18) @@
27
)
28
29
30
class GetSnmpAuthAlgorithmFromStringTestCase(unittest.TestCase):
31
    def test_invalid_status(self):
32
        with self.assertRaises(InvalidArgument):
33
            get_snmp_auth_algorithm_from_string('foo')
34
35
    def test_none_or_empty_type(self):
36
        ts = get_snmp_auth_algorithm_from_string(None)
37
        self.assertIsNone(ts)
38
        ts = get_snmp_auth_algorithm_from_string('')
39
        self.assertIsNone(ts)
40
41
    def test_sha1(self):
42
        ts = get_snmp_auth_algorithm_from_string('sha1')
43
        self.assertEqual(ts, SnmpAuthAlgorithm.SHA1)
44
45
    def test_md5(self):
46
        ts = get_snmp_auth_algorithm_from_string('md5')
47
        self.assertEqual(ts, SnmpAuthAlgorithm.MD5)
48
49
50
class GetSnmpPrivacyAlgorithmFromStringTestCase(unittest.TestCase):