Example #1
0
def edition_client(empty_app):
    """Client with token-based auth with ADMIN_EDITION permissions."""
    _c = TestClient(empty_app, EDITION_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Example #2
0
def anon_client(empty_app):
    """Anonymous client."""
    client = TestClient(empty_app, '', '')
    return client
Example #3
0
def product_client(empty_app):
    """Client with token-based auth with ADMIN_PRODUCT permissions."""
    _c = TestClient(empty_app, PRODUCT_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Example #4
0
def basic_client(empty_app):
    """Client with username/password auth, using the `app` application."""
    client = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    return client
Example #5
0
def client(empty_app):
    """Client with token-based auth, using the `app` application."""
    _c = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Example #6
0
def upload_build_client(empty_app):
    """Client with token-based auth with UPLOAD_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_UPLOADER_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Example #7
0
def deprecate_build_client(empty_app):
    """Client with token-based auth with DEPRECATE_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_DEPRECATOR_USERNAME, DEFAULT_PASSWORD)
    r = _c.get('/token')
    client = TestClient(empty_app, r.json['token'])
    return client
Example #8
0
def edition_client(empty_app):
    """Client with token-based auth with ADMIN_EDITION permissions."""
    _c = TestClient(empty_app, EDITION_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Example #9
0
def product_client(empty_app):
    """Client with token-based auth with ADMIN_PRODUCT permissions."""
    _c = TestClient(empty_app, PRODUCT_ADMIN_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Example #10
0
def client(empty_app):
    """Client with token-based auth, using the `app` application."""
    _c = TestClient(empty_app, DEFAULT_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Example #11
0
def deprecate_build_client(empty_app):
    """Client with token-based auth with DEPRECATE_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_DEPRECATOR_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client
Example #12
0
def upload_build_client(empty_app):
    """Client with token-based auth with UPLOAD_BUILD permissions."""
    _c = TestClient(empty_app, BUILD_UPLOADER_USERNAME, DEFAULT_PASSWORD)
    r = _c.get("/token")
    client = TestClient(empty_app, r.json["token"])
    return client