예제 #1
0
def test_add_roles_by_dict():
    responses.add(responses.POST,
                  'http://api/v2/roles',
                  json=answers.ROLES_LIST)

    manager = RolesManager(client)

    result = manager.add(roles=params.roles)

    assert len(result) > 0
예제 #2
0
def test_roles_partial_resp():
    responses.add(responses.POST,
                  'http://api/v2/roles',
                  json=answers.ROLES_PARTIAL,
                  status=207)

    manager = RolesManager(client)

    result = manager.add(roles=params.roles)

    assert len(result) == 1
    assert [role._info for role in result] == answers.ROLES_PARTIAL_RESULT