Skip to content

Commit

Permalink
debug linux + try to save images
Browse files Browse the repository at this point in the history
  • Loading branch information
FillBk committed Apr 16, 2024
1 parent 12d5990 commit d7e9f35
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion test/asammdf/gui/widgets/test_FileWidget_Shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down
4 changes: 3 additions & 1 deletion test/asammdf/gui/widgets/test_MainWindow_Shortcuts.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
import os
from pathlib import Path
import sys
from test.asammdf.gui.test_base import TestBase
Expand Down Expand Up @@ -56,7 +57,8 @@ def openFile(self, measurement_files):
if sys.platform != "win32":
for _ in range(100):
self.processEvents(0.1)

img_path = os.path.normpath(os.path.join(os.path.dirname(__file__), "from_main.png"))
self.mw.grab().save(img_path)
with mock.patch("asammdf.gui.widgets.main.QtWidgets.QFileDialog.getOpenFileNames") as mo_getOpenFileNames:
if measurement_files:
if isinstance(measurement_files, list):
Expand Down
2 changes: 0 additions & 2 deletions test/asammdf/gui/widgets/test_NumericWidget_Shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down Expand Up @@ -244,7 +243,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ def tearDown(self):
"""
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down
4 changes: 3 additions & 1 deletion test/asammdf/gui/widgets/test_PlotWidget_ContextMenu.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python
import json
from json import JSONDecodeError
import os
import pathlib
import re
import sys
Expand Down Expand Up @@ -781,7 +782,8 @@ def test_Menu_EnableDisable_Action_DisableAll(self):
if sys.platform != "win32":
for _ in range(100):
self.processEvents(0.1)

img_path = os.path.normpath(os.path.join(os.path.dirname(__file__), "from_context_menu.png"))
self.plot.grab().save(img_path)
# Ensure that all items are enabled
count = self.plot.channel_selection.topLevelItemCount()
for i in range(count):
Expand Down
4 changes: 3 additions & 1 deletion test/asammdf/gui/widgets/test_PlotWidget_Shortcuts.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
from math import floor
import os
import sys
from test.asammdf.gui.test_base import Pixmap
from test.asammdf.gui.widgets.test_BasePlotWidget import TestPlotWidget
Expand Down Expand Up @@ -57,7 +58,6 @@ def tearDown(self):
mo_question.return_value = QMessageBox.No
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down Expand Up @@ -637,6 +637,8 @@ def test_Plot_Plot_Shortcut_Key_Ctrl_R(self):
self.processEvents(0.1)

pm = self.plot.selected_channel_value.grab()
img_path = os.path.normpath(os.path.join(os.path.dirname(__file__), "from_ctrl_r.png"))
pm.save(img_path)
# Evaluate that plot has only Green and Red colors
self.assertTrue(Pixmap.has_color(pm, red))
self.assertTrue(Pixmap.has_color(pm, green))
Expand Down
3 changes: 0 additions & 3 deletions test/asammdf/gui/widgets/test_Tabular_BaseWidget_Shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down Expand Up @@ -192,7 +191,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down Expand Up @@ -365,7 +363,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down
2 changes: 0 additions & 2 deletions test/asammdf/gui/widgets/test_TreeWidget_Shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down Expand Up @@ -115,7 +114,6 @@ def setUp(self):
def tearDown(self):
super().tearDown()
if self.widget:
self.widget.close()
self.widget.destroy()
self.widget.deleteLater()

Expand Down

0 comments on commit d7e9f35

Please sign in to comment.