コード例 #1
0
    def test_zero_hide_plugin_function(self):
        zh = ZeroHidePlugin()
        zh.following_zeros = 3
        self.add_signal_to_form("ask.complex")
        self.form.signal_tab_controller.signal_frames[
            1].ui.cbModulationType.setCurrentText("ASK")

        self.form.signal_tab_controller.signal_frames[
            1].ui.spinBoxCenterOffset.setValue(-0.3938)
        self.form.signal_tab_controller.signal_frames[
            1].ui.spinBoxCenterOffset.editingFinished.emit()

        self.form.signal_tab_controller.signal_frames[
            1].ui.spinBoxSamplesPerSymbol.setValue(300)
        self.form.signal_tab_controller.signal_frames[
            1].ui.spinBoxSamplesPerSymbol.editingFinished.emit()

        self.form.ui.tabWidget.setCurrentIndex(1)
        test_bits = "1011001001011011011011011011011011001000000"
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3],
                         test_bits)

        action = zh.get_action(self.cframe.ui.tblViewProtocol,
                               self.cframe.protocol_undo_stack, (),
                               self.cframe.proto_analyzer, 0)
        action.trigger()
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3],
                         "1011001001011011011011011011011011001")
コード例 #2
0
ファイル: test_plugins.py プロジェクト: Cyber-Forensic/urh
    def test_zero_hide_plugin_gui(self):
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377)
        zh = ZeroHidePlugin()
        zh.following_zeros = 188
        action = zh.get_action(self.cframe.ui.tblViewProtocol, self.cframe.protocol_undo_stack, (),
                               self.cframe.proto_analyzer, 0)
        action.trigger()
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377 - 188)

        self.cframe.protocol_undo_stack.undo()
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377)
コード例 #3
0
ファイル: test_plugins.py プロジェクト: proFessorJohns/urh
    def test_zero_hide_plugin_gui(self):
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377)
        zh = ZeroHidePlugin()
        zh.following_zeros = 188
        action = zh.get_action(self.cframe.ui.tblViewProtocol, self.cframe.protocol_undo_stack, (),
                               self.cframe.proto_analyzer, 0)
        action.trigger()
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377 - 188)

        self.cframe.protocol_undo_stack.undo()
        self.assertEqual(len(self.cframe.proto_analyzer.decoded_proto_bits_str[0]), 377)
コード例 #4
0
ファイル: test_plugins.py プロジェクト: jopohl/urh
    def test_zero_hide_plugin_function(self):
        zh = ZeroHidePlugin()
        zh.following_zeros = 3
        self.add_signal_to_form("ask.complex")
        self.form.ui.tabWidget.setCurrentIndex(1)
        test_bits = "1011001001011011011011011011011011001000000"
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3], test_bits)

        action = zh.get_action(self.cframe.ui.tblViewProtocol, self.cframe.protocol_undo_stack, (),
                               self.cframe.proto_analyzer, 0)
        action.trigger()
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3], "1011001001011011011011011011011011001")
コード例 #5
0
    def test_zero_hide_plugin_function(self):
        zh = ZeroHidePlugin()
        zh.following_zeros = 3
        self.add_signal_to_form("ask.complex")
        self.form.ui.tabWidget.setCurrentIndex(1)
        test_bits = "1011001001011011011011011011011011001000000"
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3], test_bits)

        action = zh.get_action(self.cframe.ui.tblViewProtocol, self.cframe.protocol_undo_stack, (),
                               self.cframe.proto_analyzer, 0)
        action.trigger()
        self.assertEqual(self.cframe.proto_analyzer.decoded_proto_bits_str[3], "1011001001011011011011011011011011001")