-
Notifications
You must be signed in to change notification settings - Fork 881
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from andynoack/master
hurray first test!
Showing
2 changed files
with
36 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import unittest | ||
import tests.utils_testing | ||
from urh import constants | ||
from urh.controller.MainController import MainController | ||
|
||
from tests.utils_testing import get_path_for_data_file | ||
|
||
app = tests.utils_testing.app | ||
|
||
|
||
class TestSimulator(unittest.TestCase): | ||
def setUp(self): | ||
self.old_sym_len = constants.SETTINGS.value('rel_symbol_length', type=int) | ||
constants.SETTINGS.setValue('rel_symbol_length', 0) # Disable Symbols for this Test | ||
|
||
self.form = MainController() | ||
self.form.add_signalfile(get_path_for_data_file("esaver.complex")) | ||
self.sframe = self.form.signal_tab_controller.signal_frames[0] | ||
self.sim_frame = self.form.simulator_tab_controller | ||
self.form.ui.tabWidget.setCurrentIndex(3) | ||
|
||
def tearDown(self): | ||
constants.SETTINGS.setValue('rel_symbol_length', self.old_sym_len) # Restore Symbol Length | ||
|
||
def test_add_signal(self): | ||
self.sim_frame.ui.gvSimulator.scene().add_protocols([self.sframe.proto_analyzer]) | ||
self.assertEqual(len(self.sim_frame.ui.gvSimulator.scene().items), len(self.sframe.proto_analyzer.messages)) |