Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
FillBk committed Nov 15, 2023
1 parent 6b986b8 commit a09b650
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
4 changes: 2 additions & 2 deletions test/asammdf/gui/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def search_signal_from_to(pixmap, color, ax):
"""
from_to = []
image = pixmap.toImage()
if ax == 'x' or ax == 'X':
if ax == "x" or ax == "X":
for x in range(image.width()):
for y in range(image.height()):
if QtGui.QColor(image.pixel(x, y)).name() == color:
Expand All @@ -365,7 +365,7 @@ def search_signal_from_to(pixmap, color, ax):
break
return from_to

elif ax == 'y' or ax == 'Y':
elif ax == "y" or ax == "Y":
for y in range(image.height()):
for x in range(image.width()):
if QtGui.QColor(image.pixel(x, y)).name() == color:
Expand Down
28 changes: 12 additions & 16 deletions test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class TestShortcutsWOChannels(TestPlotWidget):

def setUp(self):
# Open measurement file
self.setUpFileWidget(measurement_file=self.measurement_file, default=True)
Expand Down Expand Up @@ -585,7 +584,6 @@ def test_Plot_Plot_Shortcut_Shift_Key_Alt_F(self):


class TestShortcutsWith_1_Channel(TestPlotWidget):

def setUp(self):
# Open measurement file
self.setUpFileWidget(measurement_file=self.measurement_file, default=True)
Expand Down Expand Up @@ -619,15 +617,15 @@ def setUp(self):

def test_Plot_Plot_Shortcut_Key_W(self):
"""
Check if signal is fitted properly after pressing key "W".
Check if the signal is fitted properly after pressing key "W".
Events:
- Open 'FileWidget' with valid measurement.
- Create a plot window and load 2 signals
- Press key "I"
- Press key "W"
Evaluate:
- Evaluate that window is created
- Evaluate that there are at least one column with first signal color
- Evaluate that there is at least one column with first signal color
- Evaluate first and last columns where is first signal:
> first column after pressing "I" is full black => signal colors are not there
> signal is zoomed => is extended to left side => last column contain signal color
Expand All @@ -639,7 +637,7 @@ def test_Plot_Plot_Shortcut_Key_W(self):

# search first and last column where is displayed first signal
extremesOfChannel_35 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_35.color.name(), 'x'
self.plot.plot.viewport().grab(), self.channel_35.color.name(), "x"
)
# Evaluate that there are extremes of first signal
self.assertTrue(extremesOfChannel_35)
Expand Down Expand Up @@ -856,7 +854,7 @@ def test_Plot_Plot_Shortcut_Key_X(self):
self.processEvents()

# Find where signal start and end on X axes
from_to_x = Pixmap.search_signal_from_to(self.plot.plot.viewport().grab(), self.channel_35.color.name(), 'x')
from_to_x = Pixmap.search_signal_from_to(self.plot.plot.viewport().grab(), self.channel_35.color.name(), "x")
self.assertEqual(len(from_to_x), 2)
# Search lines where signal start and end
signalStartOnLine = Pixmap.search_y_of_signal_in_x(
Expand Down Expand Up @@ -1053,7 +1051,6 @@ def test_Plot_Plot_Shortcut_Key_Alt_R_Alt_S(self):


class TestShortcutsWith_2_Channels(TestPlotWidget):

def setUp(self):
# Open measurement file
self.setUpFileWidget(measurement_file=self.measurement_file, default=True)
Expand Down Expand Up @@ -1189,16 +1186,16 @@ def test_Plot_Plot_Shortcut_Key_Shift_Arrows(self):
QtTest.QTest.keyClick(self.plot.plot.viewport(), QtCore.Qt.Key_S)
self.processEvents()
old_from_to_y_channel_36 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_36.color.name(), 'y'
self.plot.plot.viewport().grab(), self.channel_36.color.name(), "y"
)
old_from_to_y_channel_37 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_37.color.name(), 'y'
self.plot.plot.viewport().grab(), self.channel_37.color.name(), "y"
)
old_from_to_x_channel_36 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_36.color.name(), 'x'
self.plot.plot.viewport().grab(), self.channel_36.color.name(), "x"
)
old_from_to_x_channel_37 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_37.color.name(), 'x'
self.plot.plot.viewport().grab(), self.channel_37.color.name(), "x"
)

self.mouseClick_WidgetItem(self.channel_36)
Expand All @@ -1217,16 +1214,16 @@ def test_Plot_Plot_Shortcut_Key_Shift_Arrows(self):
self.processEvents()

new_from_to_y_channel_36 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_36.color.name(), 'y'
self.plot.plot.viewport().grab(), self.channel_36.color.name(), "y"
)
new_from_to_y_channel_37 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_37.color.name(), 'y'
self.plot.plot.viewport().grab(), self.channel_37.color.name(), "y"
)
new_from_to_x_channel_36 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_36.color.name(), 'x'
self.plot.plot.viewport().grab(), self.channel_36.color.name(), "x"
)
new_from_to_x_channel_37 = Pixmap.search_signal_from_to(
self.plot.plot.viewport().grab(), self.channel_37.color.name(), 'x'
self.plot.plot.viewport().grab(), self.channel_37.color.name(), "x"
)

# Evaluate
Expand Down Expand Up @@ -1296,7 +1293,6 @@ def test_Plot_Channel_Selection_Shortcut_Key_C(self):


class TestShortcutsWith_3_Channels(TestPlotWidget):

def setUp(self):
# Open measurement file
self.setUpFileWidget(measurement_file=self.measurement_file, default=True)
Expand Down

0 comments on commit a09b650

Please sign in to comment.