예제 #1
0
    def test_dialog_options_altered_libdmtx(self, mock_value, mock_setValue):
        "User chooses zbar"
        side_effect = {}.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg._radio_libdmtx.setChecked(True)
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'libdmtx')
    def test_dialog_options_altered_libdmtx(self, mock_value, mock_setValue):
        "User chooses zbar"
        side_effect = {}.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg._radio_libdmtx.setChecked(True)
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'libdmtx')
    def test_dialog_options_not_changed(self, mock_value, mock_setValue):
        "User does not alter options"
        side_effect = {'barcode/engine': 'libdmtx',
                       'barcode/inlite-format': 'qrcode'}.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'libdmtx')
        mock_setValue.assert_any_call('barcode/inlite-format', 'qrcode')
예제 #4
0
    def test_dialog_options_altered_inlite_1d(self, mock_value, mock_setValue):
        "User chooses Inlite 1D"
        side_effect = {}.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg._radio_inlite.setChecked(True)
        dlg._inlite_1d.setChecked(True)
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'inlite')
        mock_setValue.assert_any_call('barcode/inlite-format', '1d')
    def test_dialog_options_altered_inlite_qrcode(self, mock_value, mock_setValue):
        "User chooses Inlite QR Code"
        side_effect = {}.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg._radio_inlite.setChecked(True)
        dlg._inlite_qr.setChecked(True)
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'inlite')
        mock_setValue.assert_any_call('barcode/inlite-format', 'qrcode')
예제 #6
0
    def test_dialog_options_not_changed(self, mock_value, mock_setValue):
        "User does not alter options"
        side_effect = {
            'barcode/engine': 'libdmtx',
            'barcode/inlite-format': 'qrcode'
        }.get
        mock_value.side_effect = side_effect
        dlg = BarcodeDialog()
        dlg.accept()

        mock_setValue.assert_any_call('barcode/engine', 'libdmtx')
        mock_setValue.assert_any_call('barcode/inlite-format', 'qrcode')