Code Duplication    Length = 22-22 lines in 2 locations

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

@@ 25-46 (lines=22) @@
22
from gvm.protocols.gmpv208 import TicketStatus, get_ticket_status_from_string
23
24
25
class GetTicketStatusFromStringTestCase(unittest.TestCase):
26
    def test_invalid_status(self):
27
        with self.assertRaises(InvalidArgument):
28
            get_ticket_status_from_string('foo')
29
30
    def test_none_or_empty_type(self):
31
        ts = get_ticket_status_from_string(None)
32
        self.assertIsNone(ts)
33
        ts = get_ticket_status_from_string('')
34
        self.assertIsNone(ts)
35
36
    def test_ticket_status_open(self):
37
        ts = get_ticket_status_from_string('open')
38
        self.assertEqual(ts, TicketStatus.OPEN)
39
40
    def test_ticket_status_fixed(self):
41
        ts = get_ticket_status_from_string('fixed')
42
        self.assertEqual(ts, TicketStatus.FIXED)
43
44
    def test_ticket_status_closed(self):
45
        ts = get_ticket_status_from_string('closed')
46
        self.assertEqual(ts, TicketStatus.CLOSED)
47

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

@@ 25-46 (lines=22) @@
22
from gvm.protocols.gmpv214 import TicketStatus, get_ticket_status_from_string
23
24
25
class GetTicketStatusFromStringTestCase(unittest.TestCase):
26
    def test_invalid_status(self):
27
        with self.assertRaises(InvalidArgument):
28
            get_ticket_status_from_string('foo')
29
30
    def test_none_or_empty_type(self):
31
        ts = get_ticket_status_from_string(None)
32
        self.assertIsNone(ts)
33
        ts = get_ticket_status_from_string('')
34
        self.assertIsNone(ts)
35
36
    def test_ticket_status_open(self):
37
        ts = get_ticket_status_from_string('open')
38
        self.assertEqual(ts, TicketStatus.OPEN)
39
40
    def test_ticket_status_fixed(self):
41
        ts = get_ticket_status_from_string('fixed')
42
        self.assertEqual(ts, TicketStatus.FIXED)
43
44
    def test_ticket_status_closed(self):
45
        ts = get_ticket_status_from_string('closed')
46
        self.assertEqual(ts, TicketStatus.CLOSED)
47