Add test for trying to pull the catalog under a disabled namespace
This commit is contained in:
parent
892cc82b6a
commit
fdd0db7a7f
2 changed files with 18 additions and 1 deletions
|
@ -739,6 +739,21 @@ def test_catalog_caching(v2_protocol, basic_images, liveserver_session, app_relo
|
|||
assert set(cached_results) == set(results)
|
||||
|
||||
|
||||
def test_catalog_disabled_namespace(v2_protocol, basic_images, liveserver_session, app_reloader,
|
||||
liveserver, registry_server_executor):
|
||||
credentials = ('devtable', 'password')
|
||||
|
||||
# Get a valid token.
|
||||
token, _ = v2_protocol.auth(liveserver_session, credentials, 'devtable', 'simple')
|
||||
|
||||
# Disable the devtable namespace.
|
||||
registry_server_executor.on(liveserver).disable_namespace('devtable')
|
||||
|
||||
# Try to retrieve the catalog and ensure it fails to return any results.
|
||||
results = v2_protocol.catalog(liveserver_session, bearer_token=token)
|
||||
assert len(results) == 0
|
||||
|
||||
|
||||
@pytest.mark.parametrize('username, namespace, repository', [
|
||||
('devtable', 'devtable', 'simple'),
|
||||
('devtable', 'devtable', 'gargantuan'),
|
||||
|
|
Reference in a new issue