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
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