This repository has been archived on 2020-03-24. You can view files and clone it, but cannot push or open issues or pull requests.
quay/endpoints/test/test_common.py

26 lines
567 B
Python
Raw Normal View History

2017-07-20 18:36:15 +00:00
import pytest
from endpoints.common import common_login
from test.fixtures import *
from endpoints.common_models_pre_oci import pre_oci_model as model
2017-07-20 18:36:15 +00:00
@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)
2017-07-20 18:36:15 +00:00
with app.app_context():
assert common_login(uuid) == expect_success