Pull out security scanner validation into validator class
This commit is contained in:
parent
c0f7530b29
commit
3db4c15459
5 changed files with 168 additions and 29 deletions
|
@ -316,6 +316,13 @@ class FakeSecurityScanner(object):
|
|||
'content': json.dumps(response),
|
||||
}
|
||||
|
||||
@urlmatch(netloc=r'(.*\.)?' + self.hostname, path=r'/v1/metrics$', method='GET')
|
||||
def metrics(url, _):
|
||||
return {
|
||||
'status_code': 200,
|
||||
'content': json.dumps({'fake': True}),
|
||||
}
|
||||
|
||||
@all_requests
|
||||
def response_content(url, _):
|
||||
return {
|
||||
|
@ -324,4 +331,4 @@ class FakeSecurityScanner(object):
|
|||
}
|
||||
|
||||
return [get_layer_mock, post_layer_mock, remove_layer_mock, get_notification,
|
||||
delete_notification, response_content]
|
||||
delete_notification, metrics, response_content]
|
||||
|
|
Reference in a new issue