Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
tov101 committed Oct 10, 2023
1 parent 6eeb86a commit e546b11
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/asammdf/gui/widgets/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,6 @@ def keyPressEvent(self, event):
self.plot.plot.update()

elif modifiers == (QtCore.Qt.ControlModifier | QtCore.Qt.ShiftModifier) and key == QtCore.Qt.Key_C:
clipboard_text = None
selected_items = [
item
for item in self.selectedItems()
Expand Down
8 changes: 3 additions & 5 deletions test/asammdf/gui/widgets/test_PlotWidget_ContextMenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
from json import JSONDecodeError
import re
import sys
from test.asammdf.gui.widgets.test_BasePlotWidget import TestPlotWidget
import unittest
from unittest import mock
from unittest.mock import ANY

from PySide6 import QtCore, QtTest, QtWidgets

from test.asammdf.gui.widgets.test_BasePlotWidget import TestPlotWidget


class TestContextMenu(TestPlotWidget):
# Note: Test Plot Widget through FileWidget.
Expand Down Expand Up @@ -79,7 +78,7 @@ def test_Action_SearchItem_NonexistentChannel(self):
self.assertEqual(1, len(self.plot.channel_selection.selectedItems()))

with mock.patch("asammdf.gui.widgets.tree.QtWidgets.QInputDialog.getText") as mo_getText, mock.patch(
"asammdf.gui.widgets.tree.MessageBox.warning"
"asammdf.gui.widgets.tree.MessageBox.warning"
) as mo_warning:
mo_getText.return_value = self.id(), True
self.context_menu(action_text="Search item")
Expand All @@ -104,7 +103,7 @@ def test_Action_SearchItem_ExistentChannel(self):
self.assertEqual(1, len(self.plot.channel_selection.selectedItems()))

with mock.patch("asammdf.gui.widgets.tree.QtWidgets.QInputDialog.getText") as mo_getText, mock.patch(
"asammdf.gui.widgets.tree.MessageBox.warning"
"asammdf.gui.widgets.tree.MessageBox.warning"
) as mo_warning:
mo_getText.return_value = self.plot_channel_b.text(self.Column.NAME), True
self.context_menu(action_text="Search item")
Expand Down Expand Up @@ -916,7 +915,6 @@ def test_Menu_EnableDisable_Action_DisableAllButThis(self):
mo_getText.return_value = "A", True
self.context_menu(action_text="Add channel group [Shift+Insert]")


positions_src = self.plot.channel_selection.visualItemRect(self.plot_channel_b).center()
self.context_menu(action_text="Disable all but this", position=positions_src)

Expand Down

0 comments on commit e546b11

Please sign in to comment.