def test_setup(self):
     with patch('boto3.client') as mock_client:
         with patch('boto3.client.create_deployment'
                    ) as boto_create_deployment:
             with patch('boto3.client.describe_instances'
                        ) as boto_describe_instances:
                 with open('test/json_data/describe_instances.json'
                           ) as json_file:
                     data = json.load(json_file)
                     boto_create_deployment.return_value = "{ 'DeploymentId': 'DEPLOYMENTID' }"
                     boto_describe_instances.return_value = data
                     modules.setup('eu-west-1', 'STACKID', 'LAYERID')
                     self.assertEqual(mock_client.call_count, 3)
Exemple #2
0
 def test_run_setup(self):
     usage_stdout = StringIO()
     with contextlib.redirect_stdout(usage_stdout):
         modules.setup(region=region, stack=stack, layer=layer)
     output = usage_stdout.getvalue().strip()
     self.assertIn('setup main function testing', output)
Exemple #3
0
#!/usr/bin/python3

from modules import tha, os, water, switch, setup, analyze_test  # importing modules
from modules import events  # importing variables
"""
setup()
os.system("play audio (All systems active, command mode activated)")
w = th.Thread(water, ())				#create water thread
w.Start()
if w.Isalive:
	th_ids["water"] = water
else:
	log_error("Error: unable to start water thread")
"""

if __name__ == "__main__":
    while True:
        i_cmd = ""
        i_cmd = input("Enter command: ")

        check = analyze_test(i_cmd)
        if check:
            switch()
        continue
Exemple #4
0
# -*- coding:utf-8 -*-

import nodes
import modules
import module_loader

modules.setup(module_loader.ModuleLoader())