def setup_module(module): """setup_module function for functest based python tests""" if not hasattr(windmill, 'settings'): admin_lib.configure_global_settings(logging_on=False) if not windmill.is_active: module.windmill_dict = admin_lib.setup() else: module.windmill_dict = admin_lib.shell_objects_dict
def main(): import windmill windmill.stdout, windmill.stdin = sys.stdout, sys.stdin from windmill.bin.admin_lib import configure_global_settings, setup configure_global_settings() shell_objects = setup() app = App(shell_objects=shell_objects) #shell_objects['wxwindmill_app'] = app app.MainLoop()
def setUp(self): import windmill windmill.stdout, windmill.stdin = sys.stdout, sys.stdin from windmill.bin.admin_lib import configure_global_settings, setup configure_global_settings() windmill.settings['TEST_URL'] = self.test_url if hasattr(self,"windmill_settings"): for (setting,value) in self.windmill_settings.iteritems(): windmill.settings[setting] = value self.windmill_shell_objects = setup()
def handle(self, *args, **options): """ This is a rewrite of windmill.management.commands.test_windmill that uses nose instead of functest. """ from windmill.bin import admin_lib from windmill.conf import global_settings import nose self.port = options['port'] # Setup DB self.setup_test_db() # Start a servers (django web server & Hadoop) server_container = ServerContainer() server_container.start_test_server() LOG.info("Server running on %d" % server_container.server_thread.port) self.start_helper_servers() # Configure windmill global_settings.TEST_URL = 'http://127.0.0.1:%d' % server_container.server_thread.port # For now, we only handle Firefox. global_settings.START_FIREFOX = True admin_lib.configure_global_settings(logging_on=False) # Start windmill proxy server windmill_obj = admin_lib.setup() # Run tests with nose nose_args = self.find_modules() LOG.info("Testing modules: " + repr(nose_args)) if "--" in sys.argv: nose_args.extend(sys.argv[sys.argv.index("--") + 1:]) res = nose.run(argv=nose_args) # Stop servers self.stop_helper_servers() server_container.stop_test_server() # Stop windmill admin_lib.teardown(windmill_obj) time.sleep(0.25) if res: sys.exit(0) else: sys.exit(1)
def initialize_windmill(self): if self.is_windmill_initialized(): return self._windmill_initialized = True # global windmill setup # Code adapted from http://trac.getwindmill.com/browser/trunk/windmill/authoring/unit.py windmill.stdout = self.logfile windmill.stderr = self.logfile windmill.stdin = sys.stdin configure_global_settings(logging_on=False) windmill.settings['TEST_URL'] = self.url self.disable_windmill_console_log_spam() #windmill.settings['INSTALL_FIREBUG'] = 'firebug' # Then start windmill and the browser self.windmill_shell = setup() self.windmill_shell['start_'+self.windmill_browser]()
def initialize_windmill(self): if self.is_windmill_initialized(): return self._windmill_initialized = True # global windmill setup # Code adapted from http://trac.getwindmill.com/browser/trunk/windmill/authoring/unit.py windmill.stdout = self.logfile windmill.stderr = self.logfile windmill.stdin = sys.stdin configure_global_settings(logging_on=False) windmill.settings['TEST_URL'] = self.url self.disable_windmill_console_log_spam() #windmill.settings['INSTALL_FIREBUG'] = 'firebug' # Then start windmill and the browser self.windmill_shell = setup() self.windmill_shell['start_' + self.windmill_browser]()
def setup_module(module): """setup_module function for functest based python tests""" if functest.registry.get('functest_cli', False): assert functest.registry.has_key('browser') # Make sure browser= was passed to functest import windmill if not hasattr(windmill, 'settings'): admin_lib.configure_global_settings(logging_on=False) if functest.registry.get('url', False): windmill.settings['TEST_URL'] = functest.registry['url'] if functest.registry.get('functest_cli', False): windmill.settings['START_'+functest.registry.get('browser').upper()] = True if functest.registry.get('browser_debugging', False): WindmillTestClient.browser_debugging = True if not windmill.is_active: module.windmill_dict = admin_lib.setup() else: module.windmill_dict = admin_lib.shell_objects_dict
def setup_module(module): """setup_module function for functest based python tests""" if functest.registry.get("functest_cli", False): assert functest.registry.has_key("browser") # Make sure browser= was passed to functest import windmill if not hasattr(windmill, "settings"): admin_lib.configure_global_settings(logging_on=False) if functest.registry.get("url", False): windmill.settings["TEST_URL"] = functest.registry["url"] if functest.registry.get("functest_cli", False): windmill.settings["START_" + functest.registry.get("browser").upper()] = True if functest.registry.get("browser_debugging", False): WindmillTestClient.browser_debugging = True if not windmill.is_active: module.windmill_dict = admin_lib.setup() else: module.windmill_dict = admin_lib.shell_objects_dict
def setup_module(module): """setup_module function for functest based python tests""" if functest.registry.get('functest_cli', False): assert functest.registry.has_key( 'browser') # Make sure browser= was passed to functest import windmill if not hasattr(windmill, 'settings'): admin_lib.configure_global_settings(logging_on=False) if functest.registry.get('url', False): windmill.settings['TEST_URL'] = functest.registry['url'] if functest.registry.get('functest_cli', False): windmill.settings['START_' + functest.registry.get('browser').upper()] = True if functest.registry.get('browser_debugging', False): WindmillTestClient.browser_debugging = True if not windmill.is_active: module.windmill_dict = admin_lib.setup() else: module.windmill_dict = admin_lib.shell_objects_dict