| @@ 28-56 (lines=29) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpDeleteReportFormatTestCase: |
|
| 29 | def test_delete(self): |
|
| 30 | self.gmp.delete_report_format('a1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<delete_report_format report_format_id="a1" ultimate="0"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_delete_ultimate(self): |
|
| 37 | self.gmp.delete_report_format('a1', ultimate=True) |
|
| 38 | ||
| 39 | self.connection.send.has_been_called_with( |
|
| 40 | '<delete_report_format report_format_id="a1" ultimate="1"/>' |
|
| 41 | ) |
|
| 42 | ||
| 43 | def test_missing_id(self): |
|
| 44 | with self.assertRaises(GvmError): |
|
| 45 | self.gmp.delete_report_format(None) |
|
| 46 | ||
| 47 | with self.assertRaises(GvmError): |
|
| 48 | self.gmp.delete_report_format('') |
|
| 49 | ||
| 50 | def test_delete_with_type(self): |
|
| 51 | self.gmp.delete_report_format(ReportFormatType.SVG) |
|
| 52 | ||
| 53 | report_format_id = get_report_format_id_from_string('svg').value |
|
| 54 | self.connection.send.has_been_called_with( |
|
| 55 | '<delete_report_format ' |
|
| 56 | 'report_format_id="{}" ultimate="0"/>'.format(report_format_id) |
|
| 57 | ) |
|
| 58 | ||
| 59 | ||
| @@ 28-56 (lines=29) @@ | ||
| 25 | ) |
|
| 26 | ||
| 27 | ||
| 28 | class GmpDeleteReportFormatTestCase: |
|
| 29 | def test_delete(self): |
|
| 30 | self.gmp.delete_report_format('a1') |
|
| 31 | ||
| 32 | self.connection.send.has_been_called_with( |
|
| 33 | '<delete_report_format report_format_id="a1" ultimate="0"/>' |
|
| 34 | ) |
|
| 35 | ||
| 36 | def test_delete_ultimate(self): |
|
| 37 | self.gmp.delete_report_format('a1', ultimate=True) |
|
| 38 | ||
| 39 | self.connection.send.has_been_called_with( |
|
| 40 | '<delete_report_format report_format_id="a1" ultimate="1"/>' |
|
| 41 | ) |
|
| 42 | ||
| 43 | def test_missing_id(self): |
|
| 44 | with self.assertRaises(GvmError): |
|
| 45 | self.gmp.delete_report_format(None) |
|
| 46 | ||
| 47 | with self.assertRaises(GvmError): |
|
| 48 | self.gmp.delete_report_format('') |
|
| 49 | ||
| 50 | def test_delete_with_type(self): |
|
| 51 | self.gmp.delete_report_format(ReportFormatType.SVG) |
|
| 52 | ||
| 53 | report_format_id = get_report_format_id_from_string('svg').value |
|
| 54 | self.connection.send.has_been_called_with( |
|
| 55 | '<delete_report_format ' |
|
| 56 | 'report_format_id="{}" ultimate="0"/>'.format(report_format_id) |
|
| 57 | ) |
|
| 58 | ||
| 59 | ||