コード例 #1
0
    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()
コード例 #2
0
ファイル: test_server.py プロジェクト: Marilyth/MSS
 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)
コード例 #3
0
ファイル: test_chat.py プロジェクト: Marilyth/MSS
 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 = []
コード例 #4
0
    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()
コード例 #5
0
ファイル: test_utils.py プロジェクト: nakul-shahdadpuri/MSS
 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()
コード例 #6
0
 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()
コード例 #7
0
 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()
コード例 #8
0
 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()
コード例 #9
0
ファイル: test_mscolab.py プロジェクト: iamapickle/MSS
 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)
コード例 #10
0
    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)
コード例 #11
0
    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]
コード例 #12
0
    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)