Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhrisca committed Dec 7, 2023
1 parent c7a30b0 commit bf59a03
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions test/asammdf/gui/widgets/test_FileWidget_TabChannels.py
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ def test_PushButton_ClearAll(self):
while iterator.value():
item = iterator.value()
item.setCheckState(0, QtCore.Qt.CheckState.Checked)
self.assertTrue(item.checkState(0))
self.assertTrue(item.checkState(0) == QtCore.Qt.CheckState.Checked)
iterator += 1
# Press PushButton: "Clear all selected channels"
QtTest.QTest.mouseClick(self.widget.clear_channels_btn, QtCore.Qt.MouseButton.LeftButton)
Expand All @@ -521,15 +521,15 @@ def test_PushButton_ClearAll(self):
iterator = QtWidgets.QTreeWidgetItemIterator(self.widget.channels_tree)
while iterator.value():
item = iterator.value()
self.assertFalse(item.checkState(0))
self.assertFalse(item.checkState(0) == QtCore.Qt.CheckState.Unchecked)
iterator += 1

# Switch ComboBox to "Internal file structure"
self.widget.channel_view.setCurrentText("Internal file structure")
while iterator.value():
item = iterator.value()
item.setCheckState(0, QtCore.Qt.CheckState.Checked)
self.assertTrue(item.checkState(0))
self.assertTrue(item.checkState(0) == QtCore.Qt.CheckState.Checked)
iterator += 1
# Press PushButton: "Clear all selected channels"
QtTest.QTest.mouseClick(self.widget.clear_channels_btn, QtCore.Qt.MouseButton.LeftButton)
Expand All @@ -538,7 +538,7 @@ def test_PushButton_ClearAll(self):
iterator = QtWidgets.QTreeWidgetItemIterator(self.widget.channels_tree)
while iterator.value():
item = iterator.value()
self.assertFalse(item.checkState(0))
self.assertFalse(item.checkState(0) == QtCore.Qt.CheckState.Unchecked)
iterator += 1

# Switch ComboBox to "Selected channels only"
Expand All @@ -548,7 +548,7 @@ def test_PushButton_ClearAll(self):
iterator = QtWidgets.QTreeWidgetItemIterator(self.widget.channels_tree)
while iterator.value():
item = iterator.value()
self.assertFalse(item.checkState(0))
self.assertFalse(item.checkState(0) == QtCore.Qt.CheckState.Unchecked)
iterator += 1

def test_PushButton_Search(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_PushButton_ScrambleTexts(self):
# Press PushButton ScrambleTexts
QtTest.QTest.mouseClick(self.widget.scramble_btn, QtCore.Qt.MouseButton.LeftButton)

channels = self.widget.channels_db_items
channels = list(self.widget.mdf.channels_db)

# Evaluate
scrambled_filepath = pathlib.Path(self.test_workspace, "ASAP2_Demo_V171.scrambled.mf4")
Expand All @@ -44,7 +44,7 @@ def test_PushButton_ScrambleTexts(self):
self.widget.deleteLater()

self.setUpFileWidget(measurement_file=scrambled_filepath, default=True)
scrambled_channels = self.widget.channels_db_items
scrambled_channels = list(self.widget.mdf.channels_db)
result = filter(lambda c: c in scrambled_channels, channels)
self.assertFalse(any(result))

Expand Down Expand Up @@ -127,6 +127,6 @@ def test_ExportMDF(self):

self.setUpFileWidget(measurement_file=saved_file, default=True)

channels = self.widget.channels_db_items
channels = list(self.widget.mdf.channels_db)
selected_channels.append("time")
self.assertListEqual(selected_channels, list(channels))

0 comments on commit bf59a03

Please sign in to comment.