Esempio n. 1
0
    def setup(self):
        handle_db_reset()
        self._reset_config_file()
        self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(
            PORTS)
        self.userdata = 'UV10@uv10', 'UV10', 'uv10'
        self.operation_name = "europe"
        assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
        assert add_operation(self.operation_name, "test europe")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid=self.userdata[0])
        self.user = get_user(self.userdata[0])

        self.userdata2 = '*****@*****.**', 'sree', 'sree'
        self.operation_name3 = "kerala"
        assert add_user(self.userdata2[0], self.userdata2[1],
                        self.userdata2[2])
        assert add_operation(self.operation_name3, "test kerala")
        assert add_user_to_operation(path=self.operation_name3,
                                     emailid=self.userdata2[0])

        self.userdata3 = '*****@*****.**', 'anand', 'anand'
        assert add_user(self.userdata3[0], self.userdata3[1],
                        self.userdata3[2])
        assert add_user_to_operation(path=self.operation_name3,
                                     access_level="collaborator",
                                     emailid=self.userdata3[0])

        QtTest.QTest.qWait(500)
        self.application = QtWidgets.QApplication(sys.argv)
        self.window = msui.MSUIMainWindow(
            mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR)
        self.window.show()
Esempio n. 2
0
 def setup(self):
     handle_db_reset()
     self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(
         PORTS)
     self.userdata = 'UV10@uv10', 'UV10', 'uv10'
     self.operation_name = "europe"
     assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
     assert add_operation(self.operation_name, "test europe")
     assert add_user_to_operation(path=self.operation_name,
                                  emailid=self.userdata[0])
     self.user = get_user(self.userdata[0])
     QtTest.QTest.qWait(500)
     self.application = QtWidgets.QApplication(sys.argv)
     self.window = msui.MSUIMainWindow(
         mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR)
     self.window.show()
     # connect and login to mscolab
     self._connect_to_mscolab()
     self._login(self.userdata[0], self.userdata[2])
     # activate operation and open chat window
     self._activate_operation_at_index(0)
     self.window.actionChat.trigger()
     QtWidgets.QApplication.processEvents()
     self.chat_window = self.window.mscolab.chat_window
     QtTest.QTest.qWaitForWindowExposed(self.window)
     QtWidgets.QApplication.processEvents()
Esempio n. 3
0
 def test_add_user_to_operation(self):
     with self.app.test_client():
         assert add_user(self.userdata_2[0], self.userdata_2[1],
                         self.userdata_2[2])
         assert add_operation("operation2", "description")
         assert add_user_to_operation(path="operation2",
                                      access_level='admin',
                                      emailid=self.userdata_2[0])
Esempio n. 4
0
 def setUp(self):
     handle_db_reset()
     self.userdata = 'UV10@uv10', 'UV10', 'uv10'
     self.anotheruserdata = 'UV20@uv20', 'UV20', 'uv20'
     self.operation_name = "europe"
     socketio, self.cm, self.fm = setup_managers(self.app)
     assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
     assert add_operation(self.operation_name, "test europe")
     assert add_user_to_operation(path=self.operation_name,
                                  emailid=self.userdata[0])
     self.user = get_user(self.userdata[0])
Esempio n. 5
0
    def setUp(self):
        handle_db_reset()
        db.init_app(self.app)
        self.fm = FileManager(self.app.config["MSCOLAB_DATA_DIR"])
        self.operation_name = "XYZ"
        self.description = "Template"
        self.userdata_0 = 'UV0@uv0', 'UV0', 'uv0'
        self.userdata_1 = "UV1@uv1", "UV1", "UV1"
        self.userdata_2 = "UV2@v2", "V2", "v2"

        assert add_user(self.userdata_0[0], self.userdata_0[1], self.userdata_0[2])
        assert add_operation(self.operation_name, self.description)
        assert add_user_to_operation(path=self.operation_name, emailid=self.userdata_0[0])
        self.user = User(self.userdata_0[0], self.userdata_0[1], self.userdata_0[2])
Esempio n. 6
0
    def setup(self):
        handle_db_reset()
        self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(
            PORTS)
        self.userdata = 'UV10@uv10', 'UV10', 'uv10'
        self.operation_name = "europe"
        assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
        assert add_operation(self.operation_name, "test europe")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid=self.userdata[0])
        self.user = get_user(self.userdata[0])

        QtTest.QTest.qWait(500)
        self.application = QtWidgets.QApplication(sys.argv)
        self.window = mss_pyui.MSSMainWindow(
            mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR)
        self.window.show()
Esempio n. 7
0
    def setup(self):
        handle_db_reset()
        self._reset_config_file()
        self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(
            PORTS)
        self.userdata = 'UV10@uv10', 'UV10', 'uv10'
        self.operation_name = "europe"
        assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
        assert add_operation(self.operation_name, "test europe")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid=self.userdata[0])
        self.user = get_user(self.userdata[0])

        QtTest.QTest.qWait(500)
        self.application = QtWidgets.QApplication(sys.argv)
        self.main_window = msui.MSUIMainWindow(
            mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR)
        self.main_window.show()
        self.window = mscolab.MSColab_ConnectDialog(
            parent=self.main_window, mscolab=self.main_window.mscolab)
        self.window.urlCb.setEditText(self.url)
        self.main_window.mscolab.connect_window = self.window
        self.window.show()
Esempio n. 8
0
 def setUp(self):
     handle_db_reset()
     self.sockets = []
     # 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, _, self.cm, self.fm = initialize_managers(self.app)
     db.init_app(self.app)
     self.userdata = 'UV10@uv10', 'UV10', 'uv10'
     self.anotheruserdata = 'UV20@uv20', 'UV20', 'uv20'
     self.operation_name = "europe"
     assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
     assert add_operation(self.operation_name, "test europe")
     assert add_user_to_operation(path=self.operation_name,
                                  emailid=self.userdata[0])
     self.user = get_user(self.userdata[0])
     assert add_user(self.anotheruserdata[0], self.anotheruserdata[1],
                     self.anotheruserdata[2])
     self.anotheruser = get_user(self.anotheruserdata[0])
     self.token = self.user.generate_auth_token()
     self.operation = get_operation(self.operation_name)
     self.url = self.get_server_url()
     self.sm = SocketsManager(self.cm, self.fm)
Esempio n. 9
0
    def setup(self):
        handle_db_reset()
        self.process, self.url, self.app, _, self.cm, self.fm = mscolab_start_server(
            PORTS)
        self.userdata = 'UV10@uv10', 'UV10', 'uv10'
        self.operation_name = "europe"
        assert add_user(self.userdata[0], self.userdata[1], self.userdata[2])
        assert add_operation(self.operation_name, "test europe")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid=self.userdata[0])
        self.user = get_user(self.userdata[0])
        assert add_user("*****@*****.**", "example", "example")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid="*****@*****.**",
                                     access_level="collaborator")
        assert add_user("*****@*****.**", "viewer", "viewer")
        assert add_user_to_operation(path=self.operation_name,
                                     emailid="*****@*****.**",
                                     access_level="viewer")
        assert add_user("*****@*****.**", "name1", "name1")
        assert add_user("*****@*****.**", "name2", "name2")
        assert add_operation("paris", "test paris")
        assert add_user_to_operation(path="paris", emailid=self.userdata[0])
        assert add_user_to_operation(path="paris", emailid="*****@*****.**")
        assert add_operation("tokyo", "test tokyo")
        assert add_user_to_operation(path="tokyo", emailid=self.userdata[0])

        QtTest.QTest.qWait(500)
        self.application = QtWidgets.QApplication(sys.argv)
        self.window = mss_pyui.MSSMainWindow(
            mscolab_data_dir=mscolab_settings.MSCOLAB_DATA_DIR)
        self.window.show()
        # connect and login to mscolab
        self._connect_to_mscolab()
        self._login(emailid=self.userdata[0], password=self.userdata[2])
        # activate operation and open chat window
        self._activate_operation_at_index(0)
        self.window.actionManageUsers.trigger()
        QtWidgets.QApplication.processEvents()
        self.admin_window = self.window.mscolab.admin_window
        QtTest.QTest.qWaitForWindowExposed(self.window)
        QtWidgets.QApplication.processEvents()