本文整理汇总了Python中pybonita.BonitaServer类的典型用法代码示例。如果您正苦于以下问题:Python BonitaServer类的具体用法?Python BonitaServer怎么用?Python BonitaServer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BonitaServer类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: test_modified
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,代码行数:29,代码来源:test_user.py
示例2: test_some_users
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,代码行数:27,代码来源:test_user.py
示例3: test_base_attributes_modified
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,代码行数:27,代码来源:test_user.py
示例4: test_unknown_role
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,代码行数:10,代码来源:test_membership.py
示例5: test_unknown_user
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,代码行数:11,代码来源:test_user.py
示例6: test_unknown_membership
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,代码行数:11,代码来源:test_membership.py
示例7: test_unknown_group
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,代码行数:11,代码来源:test_group.py
示例8: test_unknown_role
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,代码行数:11,代码来源:test_role.py
示例9: test_not_found_user_by_uuid
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,代码行数:12,代码来源:test_user.py
示例10: test_not_found_group_by_uuid
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,代码行数:12,代码来源:test_group.py
示例11: test_not_found_process
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,代码行数:12,代码来源:test_process.py
示例12: test_get_group_by_path
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,代码行数:13,代码来源:test_group.py
示例13: test_get_role_by_name
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,代码行数:13,代码来源:test_role.py
示例14: test_known_group
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,代码行数:13,代码来源:test_group.py
示例15: test_fresh_user
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,代码行数:13,代码来源:test_user.py
示例16: test_known_user
def test_known_user(self):
""" Retrieve a user using the UUID """
# Setup the response for MockServer
BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
url = '/identityAPI/getUserByUUID'
code = 200
xml = build_bonita_user_xml(uuid='996633', password='', username='username')
BonitaServer.set_response_list([[url, code, xml]])
user = BonitaUser.get_by_uuid('996633')
assert isinstance(user, BonitaUser)
assert user.uuid == '996633'
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_user.py
示例17: test_no_user
def test_no_user(self):
""" Retrieve all users but there are none """
# Setup the response for MockServer
BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
url = '/identityAPI/getUsers'
code = 200
xml = build_xml_set([])
BonitaServer.set_response_list([[url, code, xml]])
users = BonitaUser.find_all()
assert isinstance(users, list)
assert len(users) == 0
开发者ID:julozi,项目名称:pybonita,代码行数:13,代码来源:test_user.py
示例18: test_root_group
def test_root_group(self):
""" Retrieve root group : /platform """
# Setup the response for MockServer
BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
url = '/identityAPI/getGroupUsingPath'
code = 200
xml = build_bonita_group_xml(uuid='996633',name='platform')
BonitaServer.set_response_list([[url,code,xml]])
group = BonitaGroup.get_default_root()
assert isinstance(group,BonitaGroup)
assert group.name == u'platform'
assert group.parent is None
开发者ID:julozi,项目名称:pybonita,代码行数:14,代码来源:test_group.py
示例19: test_known_group_at_root
def test_known_group_at_root(self):
""" Retrieve a group using the path (at root) """
# Setup the response for MockServer
BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
url = '/identityAPI/getGroupUsingPath'
code = 200
xml = build_bonita_group_xml(uuid='996633',name='something')
BonitaServer.set_response_list([[url,code,xml]])
group = BonitaGroup.get_by_path('/something')
assert isinstance(group,BonitaGroup)
assert group.uuid == '996633'
assert group.parent is None
开发者ID:julozi,项目名称:pybonita,代码行数:14,代码来源:test_group.py
示例20: test_known_membership
def test_known_membership(self):
""" Retrieve a membership using the UUID """
# Setup the response for MockServer
BonitaServer.use('localhost', 9090, 'restuser', 'restbpm')
url = '/identityAPI/getMembershipByUUID'
code = 200
role_xml = build_bonita_role_xml(uuid='334455',name='myrole',with_class=True)
group_xml = build_bonita_group_xml(uuid='112233',name='mygroup',with_class=True)
xml = build_bonita_membership_xml(uuid='996633',role=role_xml, group=group_xml)
BonitaServer.set_response_list([[url,code,xml]])
membership = BonitaMembership.get_by_uuid('996633')
assert isinstance(membership,BonitaMembership)
assert membership.uuid == '996633'
开发者ID:julozi,项目名称:pybonita,代码行数:15,代码来源:test_membership.py
注:本文中的pybonita.BonitaServer类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论