forked from p15670423/monkey
Fix some formatting issues
This commit is contained in:
parent
ad1e85f867
commit
3607547aea
|
@ -4,8 +4,9 @@ from monkey_island.cc.environment import Environment
|
||||||
class TestingEnvironment(Environment):
|
class TestingEnvironment(Environment):
|
||||||
"""
|
"""
|
||||||
Use this environment for running Unit Tests.
|
Use this environment for running Unit Tests.
|
||||||
This will cause all mongo connections to happen via `mongomock` instead of using an actual mongodb instance.
|
This will cause all mongo connections to happen via `mongomock` instead of using an actual mongodb instance.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(TestingEnvironment, self).__init__()
|
super(TestingEnvironment, self).__init__()
|
||||||
self.testing = True
|
self.testing = True
|
||||||
|
|
|
@ -68,7 +68,8 @@ class ZeroTrustService(object):
|
||||||
all_statuses |= set(Finding.objects(test=test).distinct("status"))
|
all_statuses |= set(Finding.objects(test=test).distinct("status"))
|
||||||
|
|
||||||
for status in all_statuses:
|
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
|
worst_status = status
|
||||||
|
|
||||||
return worst_status
|
return worst_status
|
||||||
|
@ -95,7 +96,8 @@ class ZeroTrustService(object):
|
||||||
"""
|
"""
|
||||||
current_worst_status = zero_trust_consts.STATUS_UNEXECUTED
|
current_worst_status = zero_trust_consts.STATUS_UNEXECUTED
|
||||||
for finding in all_findings_for_test:
|
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
|
current_worst_status = finding.status
|
||||||
|
|
||||||
return current_worst_status
|
return current_worst_status
|
||||||
|
|
Loading…
Reference in New Issue