当前位置: 首页>>代码示例>>Python>>正文


Python BonitaServer.set_response_list方法代码示例

本文整理汇总了Python中pybonita.BonitaServer.set_response_list方法的典型用法代码示例。如果您正苦于以下问题:Python BonitaServer.set_response_list方法的具体用法?Python BonitaServer.set_response_list怎么用?Python BonitaServer.set_response_list使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pybonita.BonitaServer的用法示例。


在下文中一共展示了BonitaServer.set_response_list方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_modified

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_modified(self):
        """ Update base attributes of a BonitaUser """
        user = BonitaUser(username=u'myusername', password=u'mypassword')
        user._uuid = 'myuuid'

        # Prepare response of MockedServer
        url = '/identityAPI/updateUserByUUID'
        code = 200
        user_xml = build_bonita_user_xml(uuid='myuuid', password='mypassword', username='other_usernames')
        BonitaServer.set_response_list([[url, code, user_xml]])

        # Modify some base attributes
        user.last_name = u'last_name'
        user.title = u'Doctor'
        user.username = u'other_username'
        user.first_name = u'first_name'
        user.job_title = u'job_title'

        user._update_base_attributes()

        assert user.last_name == u'last_name'
        assert user.title == u'Doctor'
        assert user.username == u'other_username'
        assert user.first_name == u'first_name'
        assert user.job_title == u'job_title'

        dirties = user.get_dirties()
        for attribute in user.BASE_ATTRIBUTES:
            assert attribute not in dirties
开发者ID:julozi,项目名称:pybonita,代码行数:31,代码来源:test_user.py

示例2: test_some_users

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_some_users(self):
        """ Retrieve all users for a role """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getAllUsersInRoleAndGroup'
        code = 200
        user1_xml = build_bonita_user_xml(uuid='1234', password='', username='user1')
        user2_xml = build_bonita_user_xml(uuid='6789', password='', username='user2')
        xml = build_xml_list([user1_xml, user2_xml])
        BonitaServer.set_response_list([[url, code, xml]])

        role = BonitaRole('myrole', '', '')
        role.uuid = '1234'
        group = BonitaGroup('mygroup', '', '')
        group.uuid = '2345'

        users = BonitaUser.find_by_role_and_group(role, group)

        assert isinstance(users, list)
        assert len(users) == 2

        for user in users:
            assert isinstance(user, BonitaUser)

        sorted_users = sorted(users, key=lambda user: user.uuid)
        assert sorted_users[0].uuid == u'1234'
        assert sorted_users[1].uuid == u'6789'
开发者ID:julozi,项目名称:pybonita,代码行数:29,代码来源:test_user.py

示例3: test_base_attributes_modified

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_base_attributes_modified(self):
        """ Update BonitaUser base attributes """
        user = BonitaUser(username=u'myusername', password=u'mypassword')
        user._uuid = 'myuuid'
        user.clear()

        # Prepare response of MockedServer
        url = '/identityAPI/updateUserByUUID'
        code = 200
        user_xml = build_bonita_user_xml(uuid='myuuid', password='mypassword', username='other_usernames')
        BonitaServer.set_response_list([[url, code, user_xml]])

        # Modify some base attributes
        user.last_name = u'last_name'
        user.title = u'Doctor'
        user.username = u'other_username'
        user.first_name = u'first_name'
        user.job_title = u'job_title'

        user._update()

        assert user.is_modified is False
        assert user.last_name == u'last_name'
        assert user.title == u'Doctor'
        assert user.username == u'other_username'
        assert user.first_name == u'first_name'
        assert user.job_title == u'job_title'
开发者ID:julozi,项目名称:pybonita,代码行数:29,代码来源:test_user.py

示例4: test_unknown_role

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_unknown_role(self):
        """ Try to retrieve membership by role and group UUID : no role matching given UUID"""
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getMembershipForRoleAndGroup'
        code = 500
        xml = build_dumb_bonita_error_body('RoleNotFoundException',message='can\'t find Role : unknown')
        BonitaServer.set_response_list([[url,code,xml]])
        membership = BonitaMembership.get_by_role_and_group_uuid(role_uuid='unknown',group_uuid='group-14')

        assert membership == None
开发者ID:julozi,项目名称:pybonita,代码行数:12,代码来源:test_membership.py

示例5: test_unknown_user

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_unknown_user(self):
        """ Try to retrieve user by UUID but no user matching """
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getUserByUUID'
        code = 500
        xml = build_dumb_bonita_error_body('UserNotFoundException', message='can\'t find User: unknown')
        BonitaServer.set_response_list([[url, code, xml]])

        user = BonitaUser.get_by_uuid('unknown')

        assert user is None
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_user.py

示例6: test_unknown_membership

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_unknown_membership(self):
        """ Try to retrieve membership by UUID but no membership matching """
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getMembershipByUUID'
        code = 500
        xml = build_dumb_bonita_error_body('MembershipNotFoundException',message='can\'t find Membership : unknown')
        BonitaServer.set_response_list([[url,code,xml]])

        membership = BonitaMembership.get_by_uuid('unknown')

        assert membership == None
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_membership.py

示例7: test_unknown_group

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_unknown_group(self):
        """ Try to retrieve group by path but no group matching """
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getGroupUsingPath'
        code = 500
        xml = build_dumb_bonita_error_body('GroupNotFoundException',message='can\'t find Group: unknown')
        BonitaServer.set_response_list([[url,code,xml]])

        group = BonitaGroup.get_by_path('/something/unknown')

        assert group == None
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_group.py

示例8: test_unknown_role

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_unknown_role(self):
        """ Try to retrieve role by UUID but no role matching """
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getRoleByUUID'
        code = 500
        xml = build_dumb_bonita_error_body('RoleNotFoundException',message='can\'t find Role: unknown')
        BonitaServer.set_response_list([[url,code,xml]])

        role = BonitaRole.get_by_uuid('unknown')

        assert role == None
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_role.py

示例9: test_not_found_user_by_uuid

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_not_found_user_by_uuid(self):
        """ Try to retrieve user but nothing found with given key """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getUserByUUID'
        code = 500
        xml = build_dumb_bonita_error_body('UserNotFoundException', message='can\'t find User: not found uuid')
        BonitaServer.set_response_list([[url, code, xml]])

        user = BonitaUser.get(uuid='not found uuid')

        assert user is None
开发者ID:julozi,项目名称:pybonita,代码行数:14,代码来源:test_user.py

示例10: test_not_found_group_by_uuid

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_not_found_group_by_uuid(self):
        """ Try to retrieve group but nothing found with given key """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getGroupByUUID'
        code = 500
        xml = build_dumb_bonita_error_body('GroupNotFoundException',message='can\'t find Group: unknown')
        BonitaServer.set_response_list([[url,code,xml]])

        group = BonitaGroup.get(uuid='unknown')

        assert group == None
开发者ID:julozi,项目名称:pybonita,代码行数:14,代码来源:test_group.py

示例11: test_not_found_process

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_not_found_process(self):
        """ Retrieve not existing process """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/queryDefinitionAPI/getProcess/MonProcessus1--1.0'
        code = 500
        xml = build_dumb_bonita_error_body('ProcessNotFoundException',message='Bonita Error: bai_QDAPII_5\nCan\'t find a process with uuid MonProcessus1--1.0')
        BonitaServer.set_response_list([[url,code,xml]])

        process = BonitaProcess.get('MonProcessus1--1.0')

        assert process == None
开发者ID:julozi,项目名称:pybonita,代码行数:14,代码来源:test_process.py

示例12: test_get_group_by_path

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_get_group_by_path(self):
        """ Retrieve a group with path """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getGroupUsingPath'
        code = 200
        xml = build_bonita_group_xml(uuid='996633',name='mygroup')
        BonitaServer.set_response_list([[url,code,xml]])

        group = BonitaGroup.get(path='/mygroup')

        assert isinstance(group,BonitaGroup)
        assert group.name == 'mygroup'
开发者ID:julozi,项目名称:pybonita,代码行数:15,代码来源:test_group.py

示例13: test_get_role_by_name

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_get_role_by_name(self):
        """ Retrieve a role with name """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getRole'
        code = 200
        xml = build_bonita_role_xml(uuid='996633',name='myrole')
        BonitaServer.set_response_list([[url,code,xml]])

        role = BonitaRole.get(name='myrole')

        assert isinstance(role,BonitaRole)
        assert role.name == 'myrole'
开发者ID:julozi,项目名称:pybonita,代码行数:15,代码来源:test_role.py

示例14: test_known_group

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_known_group(self):
        """ Retrieve a group using the UUID """
        # Setup the response for MockServer
        BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
        url = '/identityAPI/getGroupByUUID'
        code = 200
        xml = build_bonita_group_xml(uuid='996633',name='mygroup')
        BonitaServer.set_response_list([[url,code,xml]])

        group = BonitaGroup.get_by_uuid('996633')

        assert isinstance(group,BonitaGroup)
        assert group.uuid == '996633'
开发者ID:julozi,项目名称:pybonita,代码行数:15,代码来源:test_group.py

示例15: test_fresh_user

# 需要导入模块: from pybonita import BonitaServer [as 别名]
# 或者: from pybonita.BonitaServer import set_response_list [as 别名]
    def test_fresh_user(self):
        """ Save a freshly create BonitaUser """
        user = BonitaUser(username=u'myusername', password=u'mypassword')

        url = '/identityAPI/addUser'
        code = 204
        user_xml = build_bonita_user_xml(uuid='myuuid', password='mypassword', username='myusername')
        BonitaServer.set_response_list([[url, code, user_xml]])

        user._create()

        assert user.is_modified is False
        assert user.uuid == 'myuuid'
开发者ID:julozi,项目名称:pybonita,代码行数:15,代码来源:test_user.py


注:本文中的pybonita.BonitaServer.set_response_list方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。