コード例 #1
0
    def test_ModifUserGroup(self):
        '''
        测试 修改用户组信息
        :return:
        '''

        ugn = '测试1'
        pms = UserGroup.getAllPms()
        UserGroup.createNewUserGroup(ugn, pms)

        User.createRoot()

        ''' 渲染 '''
        settings.debug_username = User.rootAccount
        user = User.obj(username=settings.debug_username)
        data = {
            'oname': '测试1',
            'name': '原测试1',
        }

        for pmn in UserGroup.getPmNames():
            if random.randint(0, 1):
                data[pmn] = 'on'

        v = Views(user)
        v.html(self.appM.request(localpart=ModifUserGroup.URL, data=data, method='POST').data)
コード例 #2
0
ファイル: test_static.py プロジェクト: lamter/WBFSystem
 def test_css(self):
     """
     :return:
     """
     user = User.obj(username=User.rootAccount)
     settings.debug_user = user
     v = Views(user)
     print 1212, StaticCSSHandler.load("button.css")
     v.html(self.appM.request(localpart=StaticCSSHandler.load("button.css"), method='GET').data)
コード例 #3
0
ファイル: test_static.py プロジェクト: lamter/WBFSystem
    def test_JavaHandler(self):
        """

        :return:
        """
        user = User.obj(username=User.rootAccount)
        settings.debug_user = user
        v = Views(user)
        v.html(self.appM.request(localpart=StaticJavaScripteHandler.load("jquery.min.js"), method='GET').data)
コード例 #4
0
ファイル: test_static.py プロジェクト: lamter/WBFSystem
    def test_test(self):
        """

        :return:
        """

        user = User.obj(username=User.rootAccount)
        settings.debug_user = user
        v = Views(user)

        v.html(self.appM.request(localpart=Test.URL, method='GET').data)
コード例 #5
0
    def test_ManageUser(self):
        '''
        :return:
        '''

        User.createRoot()
        ''' 渲染 '''
        settings.debug_username = User.rootAccount
        user = User.obj(username=settings.debug_username)

        v = Views(user)
        v.html(self.appM.request(localpart=ManageUser.URL, method='GET').data)
コード例 #6
0
    def test_CreateUserGroup(self):
        '''
        测试 创建用户组
        :return:
        '''

        settings.debug_username = User.rootAccount

        user = User.obj(username=settings.debug_username)
        if not user:
            User.createRoot()
            user = User.obj(username=settings.debug_username)

        v = Views(user)
        v.html(self.appM.request(ManageUser.url).data)
コード例 #7
0
    def test_SimTermLocalServer_GET(self):
        """
        测试 打开本地服务交互终端
        :return:
        """

        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()

        settings.debug_user = user
        ''' 渲染 '''
        v = Views(user)
        v.html(
            self.appM.request(localpart=SimTermLocalServer.URL,
                              method='GET').data)
コード例 #8
0
 def test_render_manage_user_option(self):
     '''
     渲染 管理用户选项
     :return:
     '''
     User.createRoot()
     user = User.obj(username=User.rootAccount)
     v = Views(user)
コード例 #9
0
    def test_SimTermLocalServer_POST(self):
        """
        测试 打开本地服务交互终端
        :return:
        """

        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()

        settings.debug_user = user
        data = {SimTermLocalServer.python_code: "a = u'aaa'\nprint a"}
        ''' 渲染 '''
        v = Views(user)
        v.html(
            self.appM.request(localpart=SimTermLocalServer.URL,
                              data=data,
                              method='POST').data)
コード例 #10
0
    def test_render_sim_term_local_server(self):
        """
        :return:
        """
        term_server = TerminalServer()
        term_server.term_title = '本地服务进程'
        term_server.term_output = '测试终端输出的内容'

        term_output = [term_server, term_server]

        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()
            user = User.obj(username=User.rootAccount)

        views = Views(user)
        views.render_terminal_output(term_output)
        views.render_terminal_input()

        views.render_sim_term_local_server(SimTermLocalServer)
        views.html('sim_term_local_server')
コード例 #11
0
 def test_render_manage_user(self):
     '''
     渲染 manage_user页面
     :return:
     '''
     User.createRoot()
     user = User.obj(username=User.rootAccount)
     views = Views(user)
     views.render_manage_user()
     views.html('manage_user')
コード例 #12
0
    def test_render_sim_terminal_page(self):
        '''
        测试 修改用户信息界面
        :return:
        '''
        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()
            user = User.obj(username=User.rootAccount)

        views = Views(user)
        views.render_sim_terminal_page(SimTermLocalServer)
        views.html('sim_terminal_page')
コード例 #13
0
    def test_render_modif_user(self):
        '''
        测试 修改用户信息界面
        :return:
        '''
        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()
            user = User.obj(username=User.rootAccount)

        views = Views(user)
        views.render_modif_user(user, ModifUserN, ModifUserPW, AddUG, RemoveUG)
        views.html('modif_user')
コード例 #14
0
    def test_render_create_user_group(self):
        '''
        渲染 用户组信息列表
        :return:
        '''
        User.createRoot()
        user = User.obj(username=User.rootAccount)
        ugn = '测试1'
        pms = UserGroup.getAllPms()
        UserGroup.createNewUserGroup(ugn, pms)

        views = Views(user)
        views.render_create_user_group(CreateUserGroup)
        views.html('create_user_group')
コード例 #15
0
    def test_render_create_user(self):
        '''
        测试 渲染 创建用户 界面
        :return:
        '''

        self.redis.flushdb()
        User.createRoot()
        user = User.obj(username=User.rootAccount)

        ugn = '测试1'
        pms = UserGroup.getAllPms()
        UserGroup.createNewUserGroup(ugn, pms)

        views = Views(user)
        views.render_create_user(CreateUser)
        views.html('create_user')
コード例 #16
0
    def test_render_termial_output(self):
        """
        :return:
        """
        term_server = TerminalServer()
        term_server.term_title = '测试终端输出用'
        term_server.term_output = '测试终端输出的内容'

        term_output = [term_server, term_server]

        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()
            user = User.obj(username=User.rootAccount)

        views = Views(user)
        views.render_terminal_output(term_output)
        views.html('terminal_output')
コード例 #17
0
    def test_render_user_list(self):
        '''
        渲染 用户列表
        :return:
        '''
        # self.redis.flushdb()

        user = User.obj(username=User.rootAccount)
        if not user:
            User.createRoot()
            user = User.obj(username=User.rootAccount)

        un = 'test1'
        pw = '123456'
        User.createNewUser(un, pw)

        views = Views(user)
        views.render_user_list(ModifUser)
        views.html('user_list')