def on_accepted(self): settings = self.page_3.get_settings() msg = QMessageBox() msg.setIcon(QMessageBox.Warning) msg.setWindowTitle(APP_NAME) msg.setStandardButtons(QMessageBox.Ok) if not settings['nickname']: msg.setText("Please enter a name.") msg.exec_() elif not settings['introducer']: msg.setText("Please enter an Introducer fURL.") msg.exec_() elif not is_valid_furl(settings['introducer']): msg.setText("Please enter a valid Introducer fURL.") msg.exec_() else: self.setCurrentIndex(1) self.verify_settings(settings, from_wormhole=False)
def test_is_valid_furl_tub_id_not_base32(): assert not is_valid_furl('pb://[email protected]:12345/introducer')
def test_is_valid_furl_invalid_char_in_connection_hint(): assert not is_valid_furl('pb://abc234@exam/ple.org:12345/introducer')
def test_is_valid_furl_no_host_separator(): assert not is_valid_furl('pb://abc234example.org:12345/introducer')
def test_is_valid_furl_no_port(): assert not is_valid_furl('pb://[email protected]/introducer')
def test_is_valid_furl(): assert is_valid_furl('pb://[email protected]:12345/introducer')