Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
test: make ascanct and meshct tests compat. with #1652
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
reszelaz committed Jul 12, 2021
1 parent 32d0386 commit 99a18fd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/sardana/macroserver/macros/test/test_scanct.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,28 @@ 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()

# Cast index of scan to int (the first element of the list)
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]:
Expand Down

0 comments on commit 99a18fd

Please sign in to comment.