Update for merge and make additional interface improvements
This commit is contained in:
parent
543cba352b
commit
e7d6e60d97
10 changed files with 85 additions and 170 deletions
|
@ -14,10 +14,10 @@ from test.fixtures import *
|
|||
|
||||
def assert_validated(method, method_config, error_message, namespace_name, repo_name):
|
||||
if error_message is None:
|
||||
method.validate(Repository(namespace_name, repo_name), method_config)
|
||||
method.validate(namespace_name, repo_name, method_config)
|
||||
else:
|
||||
with pytest.raises(CannotValidateNotificationMethodException) as ipe:
|
||||
method.validate(Repository(namespace_name, repo_name), method_config)
|
||||
method.validate(namespace_name, repo_name, method_config)
|
||||
assert ipe.value.message == error_message
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ def test_perform_quay_notification(target, expected_users, initialized_db):
|
|||
|
||||
event_handler = NotificationEvent.get_event('repo_push')
|
||||
|
||||
sample_data = event_handler.get_sample_data(repository, {})
|
||||
sample_data = event_handler.get_sample_data(repository.namespace_name, repository.name, {})
|
||||
|
||||
method = QuayNotificationMethod()
|
||||
method.perform(notification, event_handler, {'event_data': sample_data})
|
||||
|
@ -116,8 +116,7 @@ def test_perform_email(initialized_db):
|
|||
repository=repository)
|
||||
|
||||
event_handler = NotificationEvent.get_event('repo_push')
|
||||
|
||||
sample_data = event_handler.get_sample_data(repository, {})
|
||||
sample_data = event_handler.get_sample_data(repository.namespace_name, repository.name, {})
|
||||
|
||||
mock = Mock()
|
||||
def get_mock(*args, **kwargs):
|
||||
|
@ -143,8 +142,7 @@ def test_perform_http_call(method, method_config, netloc, initialized_db):
|
|||
repository=repository)
|
||||
|
||||
event_handler = NotificationEvent.get_event('repo_push')
|
||||
|
||||
sample_data = event_handler.get_sample_data(repository, {})
|
||||
sample_data = event_handler.get_sample_data(repository.namespace_name, repository.name, {})
|
||||
|
||||
url_hit = [False]
|
||||
@urlmatch(netloc=netloc)
|
||||
|
|
Reference in a new issue