Add a fake security scanner class for easier testing
The FakeSecurityScanner mocks out all calls that Quay is expected to make to the security scanner API, and returns faked data that can be adjusted by the calling test case
This commit is contained in:
parent
fde81c1b58
commit
15041ac5ed
6 changed files with 522 additions and 383 deletions
|
@ -20,7 +20,7 @@ class SecurityNotificationWorker(QueueWorker):
|
|||
def process_queue_item(self, data):
|
||||
self.perform_notification_work(data)
|
||||
|
||||
def perform_notification_work(self, data):
|
||||
def perform_notification_work(self, data, layer_limit=_LAYER_LIMIT):
|
||||
""" Performs the work for handling a security notification as referenced by the given data
|
||||
object. Returns True on successful handling, False on non-retryable failure and raises
|
||||
a JobException on retryable failure.
|
||||
|
@ -31,7 +31,7 @@ class SecurityNotificationWorker(QueueWorker):
|
|||
|
||||
while True:
|
||||
(response_data, should_retry) = secscan_api.get_notification(notification_name,
|
||||
layer_limit=_LAYER_LIMIT,
|
||||
layer_limit=layer_limit,
|
||||
page=current_page)
|
||||
if response_data is None:
|
||||
if should_retry:
|
||||
|
|
Reference in a new issue