Code Duplication    Length = 25-25 lines in 2 locations

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

@@ 24-48 (lines=25) @@
21
from gvm.errors import GvmError
22
23
24
class GmpDeleteAssetTestCase:
25
    def test_delete_asset(self):
26
        self.gmp.delete_asset(asset_id='a1')
27
28
        self.connection.send.has_been_called_with(
29
            '<delete_asset asset_id="a1"/>'
30
        )
31
32
    def test_delete_from_report(self):
33
        self.gmp.delete_asset(report_id='a1')
34
35
        self.connection.send.has_been_called_with(
36
            '<delete_asset report_id="a1"/>'
37
        )
38
39
    def test_delete_passing_asset_and_report(self):
40
        self.gmp.delete_asset(report_id='r1', asset_id='a1')
41
42
        self.connection.send.has_been_called_with(
43
            '<delete_asset asset_id="a1"/>'
44
        )
45
46
    def test_missing_arguments(self):
47
        with self.assertRaises(GvmError):
48
            self.gmp.delete_asset()
49
50
51
if __name__ == '__main__':

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

@@ 24-48 (lines=25) @@
21
from gvm.errors import GvmError
22
23
24
class GmpDeleteAssetTestCase:
25
    def test_delete_asset(self):
26
        self.gmp.delete_asset(asset_id='a1')
27
28
        self.connection.send.has_been_called_with(
29
            '<delete_asset asset_id="a1"/>'
30
        )
31
32
    def test_delete_from_report(self):
33
        self.gmp.delete_asset(report_id='a1')
34
35
        self.connection.send.has_been_called_with(
36
            '<delete_asset report_id="a1"/>'
37
        )
38
39
    def test_delete_passing_asset_and_report(self):
40
        self.gmp.delete_asset(report_id='r1', asset_id='a1')
41
42
        self.connection.send.has_been_called_with(
43
            '<delete_asset asset_id="a1"/>'
44
        )
45
46
    def test_missing_arguments(self):
47
        with self.assertRaises(GvmError):
48
            self.gmp.delete_asset()
49
50
51
if __name__ == '__main__':