Fix some formatting issues

This commit is contained in:
Shay Nehmad 2019-11-08 17:42:42 +02:00
parent ad1e85f867
commit 3607547aea
2 changed files with 6 additions and 3 deletions

View File

@ -6,6 +6,7 @@ class TestingEnvironment(Environment):
Use this environment for running Unit Tests.
This will cause all mongo connections to happen via `mongomock` instead of using an actual mongodb instance.
"""
def __init__(self):
super(TestingEnvironment, self).__init__()
self.testing = True

View File

@ -68,7 +68,8 @@ class ZeroTrustService(object):
all_statuses |= set(Finding.objects(test=test).distinct("status"))
for status in all_statuses:
if zero_trust_consts.ORDERED_TEST_STATUSES.index(status) < zero_trust_consts.ORDERED_TEST_STATUSES.index(worst_status):
if zero_trust_consts.ORDERED_TEST_STATUSES.index(status) \
< zero_trust_consts.ORDERED_TEST_STATUSES.index(worst_status):
worst_status = status
return worst_status
@ -95,7 +96,8 @@ class ZeroTrustService(object):
"""
current_worst_status = zero_trust_consts.STATUS_UNEXECUTED
for finding in all_findings_for_test:
if zero_trust_consts.ORDERED_TEST_STATUSES.index(finding.status) < zero_trust_consts.ORDERED_TEST_STATUSES.index(current_worst_status):
if zero_trust_consts.ORDERED_TEST_STATUSES.index(finding.status) \
< zero_trust_consts.ORDERED_TEST_STATUSES.index(current_worst_status):
current_worst_status = finding.status
return current_worst_status