Merge branch 'lumberjack' of https://bitbucket.org/yackob03/quay into lumberjack
This commit is contained in:
commit
4b8d9bd83e
5 changed files with 39 additions and 14 deletions
|
@ -134,9 +134,9 @@ class BuildNodeConfig(object):
|
||||||
|
|
||||||
|
|
||||||
class TestConfig(FlaskConfig, FakeStorage, EphemeralDB, FakeUserfiles,
|
class TestConfig(FlaskConfig, FakeStorage, EphemeralDB, FakeUserfiles,
|
||||||
FakeAnalytics):
|
FakeAnalytics, StripeTestConfig):
|
||||||
LOGGING_CONFIG = {
|
LOGGING_CONFIG = {
|
||||||
'level': logging.DEBUG,
|
'level': logging.WARN,
|
||||||
'format': LOG_FORMAT
|
'format': LOG_FORMAT
|
||||||
}
|
}
|
||||||
POPULATE_DB_TEST_DATA = True
|
POPULATE_DB_TEST_DATA = True
|
||||||
|
|
|
@ -719,10 +719,7 @@ def update_repo_api(namespace, repository):
|
||||||
def repo_logs_api(namespace, repository):
|
def repo_logs_api(namespace, repository):
|
||||||
permission = AdministerRepositoryPermission(namespace, repository)
|
permission = AdministerRepositoryPermission(namespace, repository)
|
||||||
if permission.can():
|
if permission.can():
|
||||||
print namespace
|
|
||||||
print repository
|
|
||||||
repo = model.get_repository(namespace, repository)
|
repo = model.get_repository(namespace, repository)
|
||||||
print repo
|
|
||||||
if not repo:
|
if not repo:
|
||||||
abort(404)
|
abort(404)
|
||||||
|
|
||||||
|
|
|
@ -20,6 +20,7 @@ FAKE_IMAGE_ID = str(uuid4())
|
||||||
FAKE_TAG_NAME = str(uuid4())
|
FAKE_TAG_NAME = str(uuid4())
|
||||||
FAKE_USERNAME = str(uuid4())
|
FAKE_USERNAME = str(uuid4())
|
||||||
FAKE_TOKEN = str(uuid4())
|
FAKE_TOKEN = str(uuid4())
|
||||||
|
FAKE_WEBHOOK = str(uuid4())
|
||||||
|
|
||||||
NEW_ORG_REPO_DETAILS = {
|
NEW_ORG_REPO_DETAILS = {
|
||||||
'repository': str(uuid4()),
|
'repository': str(uuid4()),
|
||||||
|
@ -29,9 +30,9 @@ NEW_ORG_REPO_DETAILS = {
|
||||||
}
|
}
|
||||||
|
|
||||||
NEW_USER_DETAILS = {
|
NEW_USER_DETAILS = {
|
||||||
'username': 'bob',
|
'username': 'bobby',
|
||||||
'password': 'password',
|
'password': 'password',
|
||||||
'email': 'jake@devtable.com',
|
'email': 'bobby@tables.com',
|
||||||
}
|
}
|
||||||
|
|
||||||
SEND_RECOVERY_DETAILS = {
|
SEND_RECOVERY_DETAILS = {
|
||||||
|
@ -217,6 +218,34 @@ def build_specs():
|
||||||
admin_code=201).set_method('POST')
|
admin_code=201).set_method('POST')
|
||||||
.set_data_from_obj(CREATE_BUILD_DETAILS)),
|
.set_data_from_obj(CREATE_BUILD_DETAILS)),
|
||||||
|
|
||||||
|
TestSpec(url_for('create_webhook', repository=PUBLIC_REPO),
|
||||||
|
admin_code=403).set_method('POST'),
|
||||||
|
TestSpec(url_for('create_webhook',
|
||||||
|
repository=ORG_REPO)).set_method('POST'),
|
||||||
|
TestSpec(url_for('create_webhook',
|
||||||
|
repository=PRIVATE_REPO)).set_method('POST'),
|
||||||
|
|
||||||
|
TestSpec(url_for('get_webhook', repository=PUBLIC_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK), admin_code=403),
|
||||||
|
TestSpec(url_for('get_webhook', repository=ORG_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK), admin_code=400),
|
||||||
|
TestSpec(url_for('get_webhook', repository=PRIVATE_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK), admin_code=400),
|
||||||
|
|
||||||
|
TestSpec(url_for('list_webhooks', repository=PUBLIC_REPO), admin_code=403),
|
||||||
|
TestSpec(url_for('list_webhooks', repository=ORG_REPO)),
|
||||||
|
TestSpec(url_for('list_webhooks', repository=PRIVATE_REPO)),
|
||||||
|
|
||||||
|
TestSpec(url_for('delete_webhook', repository=PUBLIC_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK),
|
||||||
|
admin_code=403).set_method('DELETE'),
|
||||||
|
TestSpec(url_for('delete_webhook', repository=ORG_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK),
|
||||||
|
admin_code=400).set_method('DELETE'),
|
||||||
|
TestSpec(url_for('delete_webhook', repository=PRIVATE_REPO,
|
||||||
|
public_id=FAKE_WEBHOOK),
|
||||||
|
admin_code=400).set_method('DELETE'),
|
||||||
|
|
||||||
TestSpec(url_for('list_repository_images', repository=PUBLIC_REPO),
|
TestSpec(url_for('list_repository_images', repository=PUBLIC_REPO),
|
||||||
200, 200, 200, 200),
|
200, 200, 200, 200),
|
||||||
TestSpec(url_for('list_repository_images', repository=ORG_REPO),
|
TestSpec(url_for('list_repository_images', repository=ORG_REPO),
|
||||||
|
@ -383,11 +412,11 @@ def build_specs():
|
||||||
|
|
||||||
TestSpec(url_for('get_org_subscription', orgname=ORG)),
|
TestSpec(url_for('get_org_subscription', orgname=ORG)),
|
||||||
|
|
||||||
TestSpec(url_for('repo_logs_api', repository=PUBLIC_REPO), 401, 403, 403, 403),
|
TestSpec(url_for('repo_logs_api', repository=PUBLIC_REPO), admin_code=403),
|
||||||
TestSpec(url_for('repo_logs_api', repository=ORG_REPO), 401, 403, 403, 200),
|
TestSpec(url_for('repo_logs_api', repository=ORG_REPO)),
|
||||||
TestSpec(url_for('repo_logs_api', repository=PRIVATE_REPO), 401, 403, 403, 200),
|
TestSpec(url_for('repo_logs_api', repository=PRIVATE_REPO)),
|
||||||
|
|
||||||
TestSpec(url_for('org_logs_api', orgname=ORG), 401, 403, 403, 200),
|
TestSpec(url_for('org_logs_api', orgname=ORG)),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -42,8 +42,6 @@ class _SpecTestBuilder(type):
|
||||||
rv = c.open(url, **open_kwargs)
|
rv = c.open(url, **open_kwargs)
|
||||||
msg = '%s %s: %s expected: %s' % (open_kwargs['method'], url,
|
msg = '%s %s: %s expected: %s' % (open_kwargs['method'], url,
|
||||||
rv.status_code, expected_status)
|
rv.status_code, expected_status)
|
||||||
if rv.status_code != expected_status:
|
|
||||||
print msg
|
|
||||||
self.assertEqual(rv.status_code, expected_status, msg)
|
self.assertEqual(rv.status_code, expected_status, msg)
|
||||||
return test
|
return test
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,9 @@ import logging
|
||||||
|
|
||||||
from bs4 import BeautifulSoup
|
from bs4 import BeautifulSoup
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
logging.basicConfig(level=logging.DEBUG)
|
|
||||||
|
|
||||||
def render_snapshot(url):
|
def render_snapshot(url):
|
||||||
logger.info('Snapshotting url: %s' % url)
|
logger.info('Snapshotting url: %s' % url)
|
||||||
|
|
Reference in a new issue