Pass --local-only down to the ServerStatus and Mode so that we can set shorter timeouts for local GUI tests. Update the tests to use a very short timeout

This commit is contained in:
Miguel Jacq 2018-09-27 15:43:59 +10:00
parent 2a7adb2365
commit 201f351279
No known key found for this signature in database
GPG key ID: EEA4341C6D97A0B6
5 changed files with 29 additions and 16 deletions

View file

@ -37,7 +37,7 @@ class Mode(QtWidgets.QWidget):
starting_server_error = QtCore.pyqtSignal(str)
set_server_active = QtCore.pyqtSignal(bool)
def __init__(self, common, qtapp, app, status_bar, server_status_label, system_tray, filenames=None):
def __init__(self, common, qtapp, app, status_bar, server_status_label, system_tray, filenames=None, local_only=False):
super(Mode, self).__init__()
self.common = common
self.qtapp = qtapp
@ -54,12 +54,15 @@ class Mode(QtWidgets.QWidget):
# The web object gets created in init()
self.web = None
# Local mode is passed from OnionShareGui
self.local_only = local_only
# Threads start out as None
self.onion_thread = None
self.web_thread = None
# Server status
self.server_status = ServerStatus(self.common, self.qtapp, self.app)
self.server_status = ServerStatus(self.common, self.qtapp, self.app, None, self.local_only)
self.server_status.server_started.connect(self.start_server)
self.server_status.server_stopped.connect(self.stop_server)
self.server_status.server_canceled.connect(self.cancel_server)