From ee835d51b009d87ceda98affe7f3e3830d395694 Mon Sep 17 00:00:00 2001 From: Daniel Goldberg Date: Wed, 23 May 2018 15:22:27 +0300 Subject: [PATCH] Remove Monkey testing code, dead code as it is. --- infection_monkey/requirements.txt | 2 -- infection_monkey/test/__init__.py | 0 infection_monkey/test/config__test.py | 45 --------------------------- 3 files changed, 47 deletions(-) delete mode 100644 infection_monkey/test/__init__.py delete mode 100644 infection_monkey/test/config__test.py diff --git a/infection_monkey/requirements.txt b/infection_monkey/requirements.txt index d5c1455dd..8683987c4 100644 --- a/infection_monkey/requirements.txt +++ b/infection_monkey/requirements.txt @@ -13,6 +13,4 @@ PyInstaller six ecdsa netifaces -mock -nose ipaddress diff --git a/infection_monkey/test/__init__.py b/infection_monkey/test/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/infection_monkey/test/config__test.py b/infection_monkey/test/config__test.py deleted file mode 100644 index accdd5a49..000000000 --- a/infection_monkey/test/config__test.py +++ /dev/null @@ -1,45 +0,0 @@ -# -*- coding: UTF-8 -*- -# NOTE: Launch all tests with `nosetests` command from infection_monkey dir. - -import json -import unittest - -from mock import Mock, patch - -import control - -from config import GUID - - -class ReportConfigErrorTestCase(unittest.TestCase): - """ - When unknown config variable received form the island server, skip it and report config - error back to the server. - """ - - config_response = Mock(json=Mock(return_value={'config': {'blah': 'blah'}})) - - def teardown(self): - patch.stopall() - - def test_config(self): - patch('control.requests.patch', Mock()).start() - patch('control.WormConfiguration', Mock(current_server='127.0.0.1:123')).start() - - # GIVEN the server with uknown config variable - patch('control.requests.get', Mock(return_value=self.config_response)).start() - - # WHEN monkey tries to load config from server - control.ControlClient.load_control_config() - - # THEN she reports config error back to the server - control.requests.patch.assert_called_once_with( - "https://127.0.0.1:123/api/monkey/%s" % GUID, - data=json.dumps({'config_error': True}), - headers={'content-type': 'application/json'}, - verify=False, - proxies=control.ControlClient.proxies) - - -if __name__ == '__main__': - unittest.main()