Merge pull request #2954 from coreos-inc/joseph.schorr/QS-102/user-api-filter

Add ability to filter users list to enabled users
This commit is contained in:
josephschorr 2018-01-05 15:40:50 -05:00 committed by GitHub
commit 13b738c43c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 60 additions and 40 deletions

View file

@ -0,0 +1,19 @@
import pytest
from endpoints.api.superuser import SuperUserList
from endpoints.api.test.shared import conduct_api_call
from endpoints.test.shared import client_with_identity
from test.fixtures import *
@pytest.mark.parametrize('disabled', [
(True),
(False),
])
def test_list_all_users(disabled, client):
with client_with_identity('devtable', client) as cl:
params = {'disabled': disabled}
result = conduct_api_call(cl, SuperUserList, 'GET', params, None, 200).json
assert len(result['users'])
for user in result['users']:
if not disabled:
assert user['enabled']