-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
52 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import unittest | ||
|
||
from PySide6.QtWidgets import QApplication | ||
from PySide6.QtTest import QTest | ||
from PySide6.QtCore import Qt | ||
|
||
from hyo2.ssm2.app.gui.soundspeedmanager.mainwin import MainWin | ||
|
||
|
||
class TestSoundSpeedManagerMainWin(unittest.TestCase): | ||
|
||
def setUp(self): | ||
self.app = QApplication.instance() or QApplication([]) | ||
self.window = MainWin() | ||
self.window.skip_do_you_really_quit = True | ||
self.window.show() | ||
|
||
def test_menu_file(self): | ||
|
||
# Simulate clicking the "File" menu | ||
QTest.mouseClick(self.window.menu, Qt.LeftButton, | ||
pos=self.window.menu.actionGeometry(self.window.menu.actions()[0]).center()) | ||
|
||
# Simulate clicking the "Import Input Data" menu | ||
QTest.mouseClick(self.window.menu, Qt.LeftButton, | ||
pos=self.window.file_menu.actionGeometry(self.window.file_menu.actions()[0]).center()) | ||
|
||
def tearDown(self): | ||
self.window.close() | ||
self.app.quit() | ||
|
||
|
||
def suite(): | ||
s = unittest.TestSuite() | ||
s.addTests(unittest.TestLoader().loadTestsFromTestCase(TestSoundSpeedManagerMainWin)) | ||
return s |