Merge pull request #2810 from coreos-inc/joseph.schorr/QUAY-747/common-data-interface
Convert endpoints/common into using a data interface
This commit is contained in:
commit
074b4e4981
21 changed files with 217 additions and 175 deletions
25
endpoints/test/test_common.py
Normal file
25
endpoints/test/test_common.py
Normal file
|
@ -0,0 +1,25 @@
|
|||
import pytest
|
||||
|
||||
from endpoints.common import common_login
|
||||
|
||||
from test.fixtures import *
|
||||
from endpoints.common_models_pre_oci import pre_oci_model as model
|
||||
|
||||
@pytest.mark.parametrize('username, expect_success', [
|
||||
# Valid users.
|
||||
('devtable', True),
|
||||
('public', True),
|
||||
|
||||
# Org.
|
||||
('buynlarge', False),
|
||||
|
||||
# Robot.
|
||||
('devtable+dtrobot', False),
|
||||
|
||||
# Unverified user.
|
||||
('unverified', False),
|
||||
])
|
||||
def test_common_login(username, expect_success, app):
|
||||
uuid = model.get_namespace_uuid(username)
|
||||
with app.app_context():
|
||||
assert common_login(uuid) == expect_success
|
Reference in a new issue