From 72a6cb16eff49d16ab98c6d658ddd291e8a8431e Mon Sep 17 00:00:00 2001 From: JWM Date: Fri, 23 Aug 2024 14:17:34 +0200 Subject: [PATCH] Move new arguments to the end in case it is already used --- mlx/coverity.py | 2 +- mlx/coverity_services.py | 4 ++-- tests/test_coverity.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/mlx/coverity.py b/mlx/coverity.py index 887c00e7..7c66976d 100644 --- a/mlx/coverity.py +++ b/mlx/coverity.py @@ -150,7 +150,7 @@ def get_filtered_defects(self, node): column_names = set(node["col"]) if "chart_attribute" in node and node["chart_attribute"].upper() in node.column_map: column_names.add(node["chart_attribute"]) - defects = self.coverity_service.get_defects(self.stream, self.snaphsot, node["filters"], column_names) + defects = self.coverity_service.get_defects(self.stream, node["filters"], column_names, self.snaphsot) report_info("%d received" % (defects["totalRows"])) report_info("building defects table and/or chart... ", True) return defects diff --git a/mlx/coverity_services.py b/mlx/coverity_services.py index 3eee99ce..5b827152 100644 --- a/mlx/coverity_services.py +++ b/mlx/coverity_services.py @@ -246,7 +246,7 @@ def assemble_query_filter(self, column_name, filter_values, matcher_type): "matchers": matchers } - def get_defects(self, stream, snapshot, filters, column_names): + def get_defects(self, stream, filters, column_names, snapshot): """Gets a list of defects for given stream, snapshot ID, filters and column names. If the snapshot is empty, the last snapshot is taken. If a column name does not match the name of the `columns` property, the column can not be obtained because @@ -255,9 +255,9 @@ def get_defects(self, stream, snapshot, filters, column_names): Args: stream (str): Name of the stream to query - snapshot (str): The snapshot ID; If empty the last snapshot is taken. filters (dict): Dictionary with attribute names as keys and CSV lists of attribute values to query as values column_names (list[str]): The column names + snapshot (str): The snapshot ID; If empty the last snapshot is taken. Returns: dict: The content of the request. This has a structure like: diff --git a/tests/test_coverity.py b/tests/test_coverity.py index 6869ca12..f628330b 100644 --- a/tests/test_coverity.py +++ b/tests/test_coverity.py @@ -168,7 +168,7 @@ def test_get_defects(self, filters, column_names, request_data): coverity_service.retrieve_column_keys() # Get defects with patch.object(CoverityDefectService, "retrieve_issues") as mock_method: - coverity_service.get_defects(self.fake_stream, "", filters, column_names) + coverity_service.get_defects(self.fake_stream, filters, column_names, "") data = mock_method.call_args[0][0] mock_method.assert_called_once() assert ordered(data) == ordered(request_data) @@ -199,7 +199,7 @@ def test_get_defects_with_snapshot(self): coverity_service.retrieve_column_keys() # Get defects with patch.object(CoverityDefectService, "retrieve_issues") as mock_method: - coverity_service.get_defects(self.fake_stream, "123", test_snapshot.filters, test_snapshot.column_names) + coverity_service.get_defects(self.fake_stream, test_snapshot.filters, test_snapshot.column_names, "123") data = mock_method.call_args[0][0] mock_method.assert_called_once() assert ordered(data) == ordered(test_snapshot.request_data)