def setup(self): # start mscolab server self.app = APP self.app.config[ 'SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI self.app.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR self.app.config['UPLOAD_FOLDER'] = mscolab_settings.UPLOAD_FOLDER self.app, _, cm, fm = initialize_managers(self.app) self.fm = fm self.cm = cm db.init_app(self.app) logging.debug("starting") self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=MSCOLAB_URL_TEST) self._login() self._activate_project_at_index(0) # activate project window here by clicking button QtTest.QTest.mouseClick(self.window.chatWindowBtn, QtCore.Qt.LeftButton) QtWidgets.QApplication.processEvents() self.chat_window = self.window.chat_window QtTest.QTest.qWaitForWindowExposed(self.window) QtWidgets.QApplication.processEvents()
def setup(self): mscolab_settings.enable_basic_http_authentication = False self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(PORTS, mscolab_settings) QtTest.QTest.qWait(100) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow(data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url)
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(PORTS) QtTest.QTest.qWait(500) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow(data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) self.sockets = []
def setup(self): """ User being used during test: id = 5, username = test1 """ self.port = 8084 handle_db_seed() self.app = APP self.app.config['SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI self.app.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR self.app, sockio, cm, fm = initialize_managers(self.app) self.fm = fm self.cm = cm db.init_app(self.app) self.MSCOLAB_URL_TEST = f"http://localhost:{self.port}" self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow(data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.MSCOLAB_URL_TEST) self._login() self._activate_project_at_index(0) QtTest.QTest.mouseClick(self.window.adminWindowBtn, QtCore.Qt.LeftButton) QtWidgets.QApplication.processEvents() self.admin_window = self.window.admin_window QtTest.QTest.qWaitForWindowExposed(self.window) QtWidgets.QApplication.processEvents()
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server( PORTS) QtTest.QTest.qWait(100) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) with self.app.app_context(): self.user = User.query.filter_by(id=8).first()
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(PORTS) QtTest.QTest.qWait(500) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow(data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) self._connect_to_mscolab() self._login() self._activate_project_at_index(0) QtTest.QTest.mouseClick(self.window.adminWindowBtn, QtCore.Qt.LeftButton) QtWidgets.QApplication.processEvents() self.admin_window = self.window.admin_window QtTest.QTest.qWaitForWindowExposed(self.window) QtWidgets.QApplication.processEvents()
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server( PORTS) QtTest.QTest.qWait(100) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) self.sockets = [] self.file_message_counter = [0] * 2 self.undefined_p_id = 123 self.no_perm_p_id = 2 data = {'email': 'a', 'password': '******'} r = requests.post(self.url + '/token', data=data) self.token = json.loads(r.text)['token'] with self.app.app_context(): self.user = User.query.filter_by(id=8).first()
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server( PORTS) QtTest.QTest.qWait(500) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) self.sockets = [] self.fm = file_manager.FileManager(mscolab_settings.MSCOLAB_DATA_DIR) self._example_data() self.cleanup_pid = set() data = {'email': 'a', 'password': '******'} r = requests.post(self.url + '/token', data=data) self.token = json.loads(r.text)['token'] with self.app.app_context(): self.user = User.query.filter_by(id=8).first()
def setup(self): handle_db_seed() self.port = 8084 self.app = APP self.app.config[ 'SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI self.app.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR self.app.config['UPLOAD_FOLDER'] = mscolab_settings.UPLOAD_FOLDER self.app, sockio, cm, fm = initialize_managers(self.app) self.fm = fm self.cm = cm db.init_app(self.app) self.MSCOLAB_URL_TEST = f"http://localhost:{self.port}" logging.debug("starting") self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.MSCOLAB_URL_TEST)
def setup(self): handle_db_seed() self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow(data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=MSCOLAB_URL_TEST) self.window.show() QtWidgets.QApplication.processEvents() QtTest.QTest.qWaitForWindowExposed(self.window) QtWidgets.QApplication.processEvents() self.app = APP self.app.config['SQLALCHEMY_DATABASE_URI'] = mscolab_settings.SQLALCHEMY_DB_URI self.app.config['MSCOLAB_DATA_DIR'] = mscolab_settings.MSCOLAB_DATA_DIR self.app.config['UPLOAD_FOLDER'] = mscolab_settings.UPLOAD_FOLDER self.app, _, cm, fm = initialize_managers(self.app) self.fm = fm self.cm = cm db.init_app(self.app)
def setup(self): self.process, self.url, self.app, self.sio, self.cm, self.fm = mscolab_start_server( PORTS) QtTest.QTest.qWait(500) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) with self.app.app_context(): response = mscolab_register_and_login(self.app, self.url, 'a1a@a1a', 'a1a', 'a1a') _ = mscolab_create_project(self.app, self.url, response, path='f3', description='f3 test example') self.user = User.query.filter_by(emailid="a1a@a1a").first() self.test_p_id = get_recent_pid(self.fm, self.user) self.test_sid = 25 socket_storage = {'s_id': self.test_sid, 'u_id': self.user.id} self.sockets = [socket_storage]
def setup(self): self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server( PORTS) QtTest.QTest.qWait(500) self.application = QtWidgets.QApplication(sys.argv) self.window = MSSMscolabWindow( data_dir=mscolab_settings.MSCOLAB_DATA_DIR, mscolab_server_url=self.url) self.cm = ChatManager() self.room_name = "europe" data = {'email': 'a', 'password': '******'} r = requests.post(self.url + '/token', data=data) self.token = json.loads(r.text)['token'] with self.app.app_context(): self.user = User.query.filter_by(id=8).first() data = { "token": self.token, "path": self.room_name, "description": "test description" } url = url_join(self.url, 'create_project') requests.post(url, data=data)