File tree Expand file tree Collapse file tree
tests/protocols/gmpnext/entities Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1812,22 +1812,32 @@ def export_scan_report(
18121812
18131813 def get_report_exports (
18141814 self ,
1815- * ,
1816- report_export_id : EntityID | None = None ,
18171815 ) -> T :
18181816 """Request report exports.
18191817
1820- If report_export_id is provided, only the matching report export is
1821- requested. Otherwise, the command requests a list of report exports.
1818+ The command requests a list of report exports.
1819+
1820+ Returns:
1821+ A request for the get_report_exports GMP command.
1822+ """
1823+ return self ._send_request_and_transform_response (
1824+ ReportExports .get_report_exports ()
1825+ )
1826+
1827+ def get_report_export (
1828+ self ,
1829+ report_export_id : EntityID | None = None ,
1830+ ) -> T :
1831+ """Request a single report export.
18221832
18231833 Args:
1824- report_export_id: UUID of an optional report export.
1834+ report_export_id: UUID of the report export.
18251835
18261836 Returns:
18271837 A request for the get_report_exports GMP command.
18281838 """
18291839 return self ._send_request_and_transform_response (
1830- ReportExports .get_report_exports (
1840+ ReportExports .get_report_export (
18311841 report_export_id = report_export_id ,
18321842 )
18331843 )
Original file line number Diff line number Diff line change @@ -7,16 +7,27 @@ class ReportExports:
77 @classmethod
88 def get_report_exports (
99 cls ,
10- * ,
11- report_export_id : EntityID | None = None ,
1210 ) -> Request :
1311 """Request report exports.
1412
15- If report_export_id is provided, only the matching report export is
16- requested. Otherwise, the command requests a list of report exports.
13+ The command requests a list of report exports.
14+
15+ Returns:
16+ A request for the get_report_exports GMP command.
17+ """
18+ cmd = XmlCommand ("get_report_exports" )
19+
20+ return cmd
21+
22+ @classmethod
23+ def get_report_export (
24+ cls ,
25+ report_export_id : EntityID | None = None ,
26+ ) -> Request :
27+ """Request a single report export.
1728
1829 Args:
19- report_export_id: UUID of an optional report export.
30+ report_export_id: UUID of the report export.
2031
2132 Returns:
2233 A request for the get_report_exports GMP command.
Original file line number Diff line number Diff line change 22#
33# SPDX-License-Identifier: GPL-3.0-or-later
44
5+ from .test_get_report_export import GmpGetReportExportTestMixin
56from .test_get_report_exports import GmpGetReportExportsTestMixin
67
78__all__ = [
9+ "GmpGetReportExportTestMixin" ,
810 "GmpGetReportExportsTestMixin" ,
911]
Original file line number Diff line number Diff line change 1+ # SPDX-FileCopyrightText: 2026 Greenbone AG
2+ #
3+ # SPDX-License-Identifier: GPL-3.0-or-later
4+ #
5+
6+
7+ class GmpGetReportExportTestMixin :
8+ def test_get_report_export_without_id (self ):
9+ self .gmp .get_report_export ()
10+
11+ self .connection .send .has_been_called_with (b"<get_report_exports/>" )
12+
13+ def test_get_report_export_with_id (self ):
14+ self .gmp .get_report_export (report_export_id = "e1" )
15+
16+ self .connection .send .has_been_called_with (
17+ b'<get_report_exports report_export_id="e1"/>'
18+ )
Original file line number Diff line number Diff line change @@ -9,10 +9,3 @@ def test_get_report_exports(self):
99 self .gmp .get_report_exports ()
1010
1111 self .connection .send .has_been_called_with (b"<get_report_exports/>" )
12-
13- def test_get_report_exports_with_id (self ):
14- self .gmp .get_report_exports (report_export_id = "e1" )
15-
16- self .connection .send .has_been_called_with (
17- b'<get_report_exports report_export_id="e1"/>'
18- )
Original file line number Diff line number Diff line change 66from ...gmpnext import GMPTestCase
77from .report_exports import (
88 GmpGetReportExportsTestMixin ,
9+ GmpGetReportExportTestMixin ,
910)
1011
1112
1213class GmpGmpGetReportExportsTestCase (GmpGetReportExportsTestMixin , GMPTestCase ):
1314 pass
15+
16+
17+ class GmpGmpGetReportExportTestCase (GmpGetReportExportTestMixin , GMPTestCase ):
18+ pass
You can’t perform that action at this time.
0 commit comments