Code Duplication    Length = 21-21 lines in 2 locations

tests/protocols/gmpv208/testcmds/test_delete_agent.py 1 location

@@ 24-44 (lines=21) @@
21
from gvm.errors import GvmError
22
23
24
class GmpDeleteAgentTestCase:
25
    def test_delete(self):
26
        self.gmp.delete_agent('a1')
27
28
        self.connection.send.has_been_called_with(
29
            '<delete_agent agent_id="a1" ultimate="0"/>'
30
        )
31
32
    def test_delete_ultimate(self):
33
        self.gmp.delete_agent('a1', ultimate=True)
34
35
        self.connection.send.has_been_called_with(
36
            '<delete_agent agent_id="a1" ultimate="1"/>'
37
        )
38
39
    def test_missing_alert_id(self):
40
        with self.assertRaises(GvmError):
41
            self.gmp.delete_agent(None)
42
43
        with self.assertRaises(GvmError):
44
            self.gmp.delete_agent('')
45
46
47
if __name__ == '__main__':

tests/protocols/gmpv7/testcmds/test_delete_agent.py 1 location

@@ 24-44 (lines=21) @@
21
from gvm.errors import GvmError
22
23
24
class GmpDeleteAgentTestCase:
25
    def test_delete(self):
26
        self.gmp.delete_agent('a1')
27
28
        self.connection.send.has_been_called_with(
29
            '<delete_agent agent_id="a1" ultimate="0"/>'
30
        )
31
32
    def test_delete_ultimate(self):
33
        self.gmp.delete_agent('a1', ultimate=True)
34
35
        self.connection.send.has_been_called_with(
36
            '<delete_agent agent_id="a1" ultimate="1"/>'
37
        )
38
39
    def test_missing_alert_id(self):
40
        with self.assertRaises(GvmError):
41
            self.gmp.delete_agent(None)
42
43
        with self.assertRaises(GvmError):
44
            self.gmp.delete_agent('')
45
46
47
if __name__ == '__main__':