Beispiel #1
0
def main(bound_socket=None):
    config = HookboxConfig()
    config.update_from_commandline_arguments(sys.argv)
    log.setup_logging(config)
    server = create_server(bound_socket, config, output_wrapper.outputter)
    if config['objgraph']:
        eventlet.spawn(run_objgraph, server, config)
    if config['debug']:
        eventlet.spawn(debugloop)
    try:
        server.run().wait()
    except KeyboardInterrupt:
        print "Ctr+C pressed; Exiting."
Beispiel #2
0
def main(bound_socket=None, bound_api_socket=None):
    hubs.use_hub("pyevent") # dlg test of alternate hub
    config = HookboxConfig()
    config.update_from_commandline_arguments(sys.argv)
    log.setup_logging(config)
    server = create_server(bound_socket, bound_api_socket, config, output_wrapper.outputter)
    if config['objgraph']:
        eventlet.spawn(run_objgraph, server, config)
    if config['debug']:
        eventlet.spawn(debugloop)
    try:
        server.run().wait()
    except KeyboardInterrupt:
        print "Ctr+C pressed; Exiting."
Beispiel #3
0
 def test_defaults(self):
     default_config = HookboxConfig()
     expected_defaults = [
         ('interface', '127.0.0.1'),
         ('port', 8001),
         ('cbport', 80),
         ('cbhost', '127.0.0.1'),
         ('cbpath', '/hookbox'),
         ('cookie_identifier', NoDefault),
         ('secret', NoDefault),
         ('cb_connect', 'connect'),
         ('cb_disconnect', 'disconnect'),
         ('cb_create_channel', 'create_channel'),
         ('cb_destroy_channel', 'destroy_channel'),
         ('cb_subscribe', 'subscribe'),
         ('cb_unsubscribe', 'unsubscribe'),
         ('cb_publish', 'publish'),
         ('rest_secret', NoDefault),
         ('admin_password', NoDefault),
         ('debug', False),
         ('objgraph', 0),
     ]
     for attr, default in expected_defaults:
         yield '_assert_default', default_config, attr, default
Beispiel #4
0
 def test_config_acts_like_a_dict(self):
     config = HookboxConfig()
     assert '127.0.0.1' == config['interface']
Beispiel #5
0
 def test_update_from_commandline_arguments_with_defaults(self):
     args = ['--interface', 'beano.com']
     config = HookboxConfig()
     config.update_from_commandline_arguments(args)
     assert 8001 == config.port
Beispiel #6
0
 def test_update_from_commandline_arguments(self):
     args = ['--interface', 'beano.com']
     config = HookboxConfig()
     config.update_from_commandline_arguments(args)
     assert 'beano.com' == config.interface
Beispiel #7
0
 def test_create_config_smoketest(self):
     HookboxConfig()
 def test_update_from_commandline_arguments_with_defaults(self):
     args = ['--interface', 'beano.com']
     config = HookboxConfig()
     config.update_from_commandline_arguments(args)
     assert 8001 == config.port
 def test_update_from_commandline_arguments(self):
     args = ['--interface', 'beano.com']
     config = HookboxConfig()
     config.update_from_commandline_arguments(args)
     assert 'beano.com' == config.interface