Add end-to-end notification worker tests for all notification methods
This commit is contained in:
parent
348b544f23
commit
543cba352b
3 changed files with 56 additions and 6 deletions
|
@ -29,16 +29,17 @@ class PreOCIModel(NotificationWorkerDataInterface):
|
|||
def increment_notification_failure_count(self, notification):
|
||||
model.notification.increment_notification_failure_count(notification.uuid)
|
||||
|
||||
def create_notification_for_testing(self, target_username):
|
||||
def create_notification_for_testing(self, target_username, method_name='quay_notification',
|
||||
method_config=None):
|
||||
repo = model.repository.get_repository('devtable', 'simple')
|
||||
method_data = {
|
||||
method_data = method_config or {
|
||||
'target': {
|
||||
'kind': 'user',
|
||||
'name': target_username,
|
||||
}
|
||||
}
|
||||
notification = model.notification.create_repo_notification(repo, 'build_success',
|
||||
'quay_notification', method_data, {})
|
||||
notification = model.notification.create_repo_notification(repo, 'repo_push',
|
||||
method_name, method_data, {})
|
||||
return notification.uuid
|
||||
|
||||
def user_has_local_notifications(self, target_username):
|
||||
|
|
Reference in a new issue