'--environment', required=False, default='local', help='Select an env. file to use') args = parser.parse_args() with open('conf/%s.yml' % args.environment) as c: cfg = yaml.load(c) logging.getLogger('aiohttp.access').setLevel(logging.FATAL) logging.getLogger('aiohttp_session').setLevel(logging.FATAL) logging.getLogger('aiohttp.server').setLevel(logging.FATAL) logging.getLogger('asyncio').setLevel(logging.FATAL) logging.getLogger().setLevel(logging.DEBUG) sys.path.append('') plugin_modules = build_plugins(cfg['plugins']) utility_svc = UtilityService() data_svc = DataService(CoreDao('core.db'), utility_svc) planning_svc = PlanningService(data_svc, utility_svc) operation_svc = OperationService(data_svc=data_svc, utility_svc=utility_svc, planning_svc=planning_svc, planner=cfg['planner']) auth_svc = AuthService(utility_svc=utility_svc) logging.debug('Uploaded files will be put in %s' % cfg['exfil_dir']) logging.debug('Downloaded payloads will come from %s' % cfg['payloads']) file_svc = FileSvc(cfg['payloads'], cfg['exfil_dir']) services = dict(data_svc=data_svc, auth_svc=auth_svc, utility_svc=utility_svc, operation_svc=operation_svc,
def test_decode_encode_string_functional(self): mystring = 'Speedily say has suitable disposal add boy. On forth doubt miles of child. Exercise joy man.' self.assertEqual( UtilityService.decode_bytes( UtilityService.encode_string(mystring)), mystring)
def test_encode_string(self): self.assertEqual( UtilityService.encode_string('this is a super string!'), 'dGhpcyBpcyBhIHN1cGVyIHN0cmluZyE=')
def test_decode_string(self): self.assertEqual( UtilityService.decode_bytes( 'Ynl0ZXMgdGhhdCBJIG5lZWQgZGVjb2RlZCEgSGVyZSBhcmUgdGhlIGJ5dGVzLiA=' ), 'bytes that I need decoded! Here are the bytes. ')