diff --git a/monkey/common/cloud/aws/test_aws_service.py b/monkey/common/cloud/aws/test_aws_service.py index 8b17d707d..95fa6329b 100644 --- a/monkey/common/cloud/aws/test_aws_service.py +++ b/monkey/common/cloud/aws/test_aws_service.py @@ -6,7 +6,7 @@ from .aws_service import filter_instance_data_from_aws_response __author__ = "shay.nehmad" -class TestFilterInstanceDataFromAwsResponse(TestCase): +class TestAwsService(TestCase): def test_filter_instance_data_from_aws_response(self): json_response_full = """ { diff --git a/monkey/infection_monkey/exploit/tools/test_payload_parsing.py b/monkey/infection_monkey/exploit/tools/test_payload.py similarity index 100% rename from monkey/infection_monkey/exploit/tools/test_payload_parsing.py rename to monkey/infection_monkey/exploit/tools/test_payload.py diff --git a/monkey/infection_monkey/model/test_victim_host_generator.py b/monkey/infection_monkey/model/test_victim_host_generator.py index 26ca99352..c60992fee 100644 --- a/monkey/infection_monkey/model/test_victim_host_generator.py +++ b/monkey/infection_monkey/model/test_victim_host_generator.py @@ -4,7 +4,7 @@ from common.network.network_range import CidrRange, SingleIpRange from infection_monkey.model.victim_host_generator import VictimHostGenerator -class VictimHostGeneratorTester(TestCase): +class TestVictimHostGenerator(TestCase): def setUp(self): self.cidr_range = CidrRange("10.0.0.0/28", False) # this gives us 15 hosts self.local_host_range = SingleIpRange("localhost") diff --git a/monkey/infection_monkey/utils/plugins/pluginTests/BadImport.py b/monkey/infection_monkey/utils/plugins/pluginTests/BadImport.py index ffd3ebb2d..41e8c1387 100644 --- a/monkey/infection_monkey/utils/plugins/pluginTests/BadImport.py +++ b/monkey/infection_monkey/utils/plugins/pluginTests/BadImport.py @@ -1,4 +1,4 @@ -from infection_monkey.utils.plugins.pluginTests.PluginTestClass import TestPlugin # noqa: F401 +from infection_monkey.utils.plugins.pluginTests.PluginTestClass import PluginTester # noqa: F401 class SomeDummyPlugin: diff --git a/monkey/infection_monkey/utils/plugins/pluginTests/BadInit.py b/monkey/infection_monkey/utils/plugins/pluginTests/BadInit.py index 7e4c93940..61c1df7ad 100644 --- a/monkey/infection_monkey/utils/plugins/pluginTests/BadInit.py +++ b/monkey/infection_monkey/utils/plugins/pluginTests/BadInit.py @@ -1,6 +1,6 @@ -from infection_monkey.utils.plugins.pluginTests.PluginTestClass import TestPlugin +from infection_monkey.utils.plugins.pluginTests.PluginTestClass import PluginTester -class BadPluginInit(TestPlugin): +class BadPluginInit(PluginTester): def __init__(self): raise Exception("TestException") diff --git a/monkey/infection_monkey/utils/plugins/pluginTests/ComboFile.py b/monkey/infection_monkey/utils/plugins/pluginTests/ComboFile.py index 09abae314..6f33142cc 100644 --- a/monkey/infection_monkey/utils/plugins/pluginTests/ComboFile.py +++ b/monkey/infection_monkey/utils/plugins/pluginTests/ComboFile.py @@ -1,14 +1,14 @@ -from infection_monkey.utils.plugins.pluginTests.PluginTestClass import TestPlugin +from infection_monkey.utils.plugins.pluginTests.PluginTestClass import PluginTester class NoInheritance: pass -class BadInit(TestPlugin): +class BadInit(PluginTester): def __init__(self): raise Exception("TestException") -class ProperClass(TestPlugin): +class ProperClass(PluginTester): pass diff --git a/monkey/infection_monkey/utils/plugins/pluginTests/PluginTestClass.py b/monkey/infection_monkey/utils/plugins/pluginTests/PluginTestClass.py index 310cf7f2c..4de543fb0 100644 --- a/monkey/infection_monkey/utils/plugins/pluginTests/PluginTestClass.py +++ b/monkey/infection_monkey/utils/plugins/pluginTests/PluginTestClass.py @@ -2,7 +2,7 @@ import infection_monkey.utils.plugins.pluginTests from infection_monkey.utils.plugins.plugin import Plugin -class TestPlugin(Plugin): +class PluginTester(Plugin): classes_to_load = [] @staticmethod @@ -11,7 +11,7 @@ class TestPlugin(Plugin): Decides if post breach action is enabled in config :return: True if it needs to be ran, false otherwise """ - return class_name in TestPlugin.classes_to_load + return class_name in PluginTester.classes_to_load @staticmethod def base_package_file(): diff --git a/monkey/infection_monkey/utils/plugins/pluginTests/PluginWorking.py b/monkey/infection_monkey/utils/plugins/pluginTests/PluginWorking.py index a3fe237b6..27da245f2 100644 --- a/monkey/infection_monkey/utils/plugins/pluginTests/PluginWorking.py +++ b/monkey/infection_monkey/utils/plugins/pluginTests/PluginWorking.py @@ -1,5 +1,5 @@ -from infection_monkey.utils.plugins.pluginTests.PluginTestClass import TestPlugin +from infection_monkey.utils.plugins.pluginTests.PluginTestClass import PluginTester -class PluginWorking(TestPlugin): +class PluginWorking(PluginTester): pass diff --git a/monkey/infection_monkey/utils/plugins/test_plugin.py b/monkey/infection_monkey/utils/plugins/test_plugin.py index d8034c016..35eaaed63 100644 --- a/monkey/infection_monkey/utils/plugins/test_plugin.py +++ b/monkey/infection_monkey/utils/plugins/test_plugin.py @@ -3,33 +3,33 @@ from unittest import TestCase from infection_monkey.utils.plugins.pluginTests.BadImport import SomeDummyPlugin from infection_monkey.utils.plugins.pluginTests.BadInit import BadPluginInit from infection_monkey.utils.plugins.pluginTests.ComboFile import BadInit, ProperClass -from infection_monkey.utils.plugins.pluginTests.PluginTestClass import TestPlugin +from infection_monkey.utils.plugins.pluginTests.PluginTestClass import PluginTester from infection_monkey.utils.plugins.pluginTests.PluginWorking import PluginWorking -class PluginTester(TestCase): +class TestPlugin(TestCase): def test_combo_file(self): - TestPlugin.classes_to_load = [BadInit.__name__, ProperClass.__name__] - to_init = TestPlugin.get_classes() + PluginTester.classes_to_load = [BadInit.__name__, ProperClass.__name__] + to_init = PluginTester.get_classes() self.assertEqual(len(to_init), 2) - objects = TestPlugin.get_instances() + objects = PluginTester.get_instances() self.assertEqual(len(objects), 1) def test_bad_init(self): - TestPlugin.classes_to_load = [BadPluginInit.__name__] - to_init = TestPlugin.get_classes() + PluginTester.classes_to_load = [BadPluginInit.__name__] + to_init = PluginTester.get_classes() self.assertEqual(len(to_init), 1) - objects = TestPlugin.get_instances() + objects = PluginTester.get_instances() self.assertEqual(len(objects), 0) def test_bad_import(self): - TestPlugin.classes_to_load = [SomeDummyPlugin.__name__] - to_init = TestPlugin.get_classes() + PluginTester.classes_to_load = [SomeDummyPlugin.__name__] + to_init = PluginTester.get_classes() self.assertEqual(len(to_init), 0) def test_flow(self): - TestPlugin.classes_to_load = [PluginWorking.__name__] - to_init = TestPlugin.get_classes() + PluginTester.classes_to_load = [PluginWorking.__name__] + to_init = PluginTester.get_classes() self.assertEqual(len(to_init), 1) - objects = TestPlugin.get_instances() + objects = PluginTester.get_instances() self.assertEqual(len(objects), 1) diff --git a/monkey/monkey_island/cc/environment/test__init__.py b/monkey/monkey_island/cc/environment/test_environment.py similarity index 100% rename from monkey/monkey_island/cc/environment/test__init__.py rename to monkey/monkey_island/cc/environment/test_environment.py diff --git a/monkey/monkey_island/cc/resources/test/test_log.py b/monkey/monkey_island/cc/resources/test/test_log.py index c6ec50f71..9332d71f8 100644 --- a/monkey/monkey_island/cc/resources/test/test_log.py +++ b/monkey/monkey_island/cc/resources/test/test_log.py @@ -6,7 +6,7 @@ from monkey_island.cc.database import database, mongo from monkey_island.cc.resources.auth.auth import jwt_required -class LogTest(flask_restful.Resource): +class TestLog(flask_restful.Resource): @jwt_required def get(self): find_query = json_util.loads(request.args.get("find_query")) diff --git a/monkey/monkey_island/cc/resources/test/test_monkey.py b/monkey/monkey_island/cc/resources/test/test_monkey.py index 1122141d2..5eddc61ac 100644 --- a/monkey/monkey_island/cc/resources/test/test_monkey.py +++ b/monkey/monkey_island/cc/resources/test/test_monkey.py @@ -6,7 +6,7 @@ from monkey_island.cc.database import mongo from monkey_island.cc.resources.auth.auth import jwt_required -class MonkeyTest(flask_restful.Resource): +class TestMonkey(flask_restful.Resource): @jwt_required def get(self, **kw): find_query = json_util.loads(request.args.get("find_query")) diff --git a/monkey/monkey_island/cc/resources/test/test_telemetry.py b/monkey/monkey_island/cc/resources/test/test_telemetry.py index 54be08d71..f929988ac 100644 --- a/monkey/monkey_island/cc/resources/test/test_telemetry.py +++ b/monkey/monkey_island/cc/resources/test/test_telemetry.py @@ -6,7 +6,7 @@ from monkey_island.cc.database import mongo from monkey_island.cc.resources.auth.auth import jwt_required -class TelemetryTest(flask_restful.Resource): +class TestTelemetry(flask_restful.Resource): @jwt_required def get(self, **kw): find_query = json_util.loads(request.args.get("find_query")) diff --git a/monkey/monkey_island/cc/services/edge/test_displayed_edge.py b/monkey/monkey_island/cc/services/edge/test_displayed_edge_service.py similarity index 100% rename from monkey/monkey_island/cc/services/edge/test_displayed_edge.py rename to monkey/monkey_island/cc/services/edge/test_displayed_edge_service.py diff --git a/monkey/monkey_island/cc/services/edge/test_edge.py b/monkey/monkey_island/cc/services/edge/test_edge_service.py similarity index 100% rename from monkey/monkey_island/cc/services/edge/test_edge.py rename to monkey/monkey_island/cc/services/edge/test_edge_service.py diff --git a/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/test_environment.py b/monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/test_environment_telemetry_processing.py similarity index 100% rename from monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/test_environment.py rename to monkey/monkey_island/cc/services/telemetry/processing/system_info_collectors/test_environment_telemetry_processing.py diff --git a/monkey/monkey_island/cc/services/test_bootloader.py b/monkey/monkey_island/cc/services/test_bootloader_service.py similarity index 100% rename from monkey/monkey_island/cc/services/test_bootloader.py rename to monkey/monkey_island/cc/services/test_bootloader_service.py diff --git a/monkey/monkey_island/cc/services/test_representations.py b/monkey/monkey_island/cc/services/test_representations.py index 8aadc0bed..c088c3dce 100644 --- a/monkey/monkey_island/cc/services/test_representations.py +++ b/monkey/monkey_island/cc/services/test_representations.py @@ -6,7 +6,7 @@ import bson from monkey_island.cc.services.representations import normalize_obj -class TestJsonRepresentations(TestCase): +class TestRepresentations(TestCase): def test_normalize_obj(self): # empty self.assertEqual({}, normalize_obj({})) diff --git a/monkey/monkey_island/cc/services/utils/test_node_states.py b/monkey/monkey_island/cc/services/utils/test_node_states.py index 98df5455b..e39a0c246 100644 --- a/monkey/monkey_island/cc/services/utils/test_node_states.py +++ b/monkey/monkey_island/cc/services/utils/test_node_states.py @@ -3,7 +3,7 @@ from unittest import TestCase from monkey_island.cc.services.utils.node_states import NodeStates, NoGroupsFoundException -class TestNodeGroups(TestCase): +class TestNodeStates(TestCase): def test_get_group_by_keywords(self): self.assertEqual(NodeStates.get_by_keywords(["island"]), NodeStates.ISLAND) self.assertEqual(