From 99a18fd5b7a7d9bb50538f8b628d29db9a247b51 Mon Sep 17 00:00:00 2001 From: zreszela Date: Mon, 12 Jul 2021 22:10:26 +0200 Subject: [PATCH] test: make ascanct and meshct tests compat. with #1652 ascanct and meshct tests are performing validation of macro outputs. #1652 introduced a table with motor parameters showed with macro output and this breaks the tests. Adapt tests to ignore the table with motor parameters. --- .../macroserver/macros/test/test_scanct.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/sardana/macroserver/macros/test/test_scanct.py b/src/sardana/macroserver/macros/test/test_scanct.py index 702013cadb..f9af22e44e 100644 --- a/src/sardana/macroserver/macros/test/test_scanct.py +++ b/src/sardana/macroserver/macros/test/test_scanct.py @@ -41,10 +41,20 @@ class UtilsForTests(): def parsingOutputPoints(self, log_output): """A helper method to know if points are ordered based on log_output. """ - first_data_line = 1 scan_index = 0 list_points = [] - for line, in log_output[first_data_line:]: + processing_motor_params_table = False + for line, in log_output: + line = line.lstrip() + if line.startswith("Motor"): + processing_motor_params_table = True + continue + if processing_motor_params_table: + if len(line) == 0: + processing_motor_params_table = False + continue + if line.startswith("#Pt") or len(line) == 0: + continue # Get a list of elements without white spaces between them columns = line.split() @@ -52,7 +62,7 @@ def parsingOutputPoints(self, log_output): columns[scan_index] = int(columns[scan_index]) list_points.append(columns[scan_index]) nb_points = len(list_points) - + ordered_points = 0 for i in range(len(list_points) - 1): if list_points[i + 1] >= list_points[i]: