From 3607547aea6b887bcb507579a035dbed97c69a4f Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Fri, 8 Nov 2019 17:42:42 +0200 Subject: [PATCH] Fix some formatting issues --- monkey/monkey_island/cc/environment/testing.py | 3 ++- .../cc/services/reporting/zero_trust_service.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/monkey/monkey_island/cc/environment/testing.py b/monkey/monkey_island/cc/environment/testing.py index 4f65d1710..e504a8357 100644 --- a/monkey/monkey_island/cc/environment/testing.py +++ b/monkey/monkey_island/cc/environment/testing.py @@ -4,8 +4,9 @@ from monkey_island.cc.environment import Environment 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. + 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 diff --git a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py index 9937c0b6d..dd6fad1bc 100644 --- a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py +++ b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py @@ -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