@@ 24-45 (lines=22) @@ | ||
21 | from gvm.errors import GvmError |
|
22 | ||
23 | ||
24 | class GmpGetConfigTestCase: |
|
25 | def test_get_config(self): |
|
26 | self.gmp.get_config('a1') |
|
27 | ||
28 | self.connection.send.has_been_called_with( |
|
29 | '<get_configs config_id="a1" usage_type="scan" details="1"/>' |
|
30 | ) |
|
31 | ||
32 | def test_get_config_with_tasks(self): |
|
33 | self.gmp.get_config('a1', tasks=True) |
|
34 | ||
35 | self.connection.send.has_been_called_with( |
|
36 | '<get_configs config_id="a1" usage_type="scan" ' |
|
37 | 'tasks="1" details="1"/>' |
|
38 | ) |
|
39 | ||
40 | def test_fail_without_config_id(self): |
|
41 | with self.assertRaises(GvmError): |
|
42 | self.gmp.get_config(None) |
|
43 | ||
44 | with self.assertRaises(GvmError): |
|
45 | self.gmp.get_config('') |
|
46 | ||
47 | ||
48 | if __name__ == '__main__': |
@@ 24-44 (lines=21) @@ | ||
21 | from gvm.errors import GvmError |
|
22 | ||
23 | ||
24 | class GmpGetConfigTestCase: |
|
25 | def test_get_config(self): |
|
26 | self.gmp.get_config('a1') |
|
27 | ||
28 | self.connection.send.has_been_called_with( |
|
29 | '<get_configs config_id="a1" details="1"/>' |
|
30 | ) |
|
31 | ||
32 | def test_get_config_with_tasks(self): |
|
33 | self.gmp.get_config('a1', tasks=True) |
|
34 | ||
35 | self.connection.send.has_been_called_with( |
|
36 | '<get_configs config_id="a1" tasks="1" details="1"/>' |
|
37 | ) |
|
38 | ||
39 | def test_fail_without_config_id(self): |
|
40 | with self.assertRaises(GvmError): |
|
41 | self.gmp.get_config(None) |
|
42 | ||
43 | with self.assertRaises(GvmError): |
|
44 | self.gmp.get_config('') |
|
45 | ||
46 | ||
47 | if __name__ == '__main__': |