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

    # Setup DB
    self.setup_test_db()

    # Start a servers (django web server & Hadoop)
    server_container = ServerContainer()
    server_container.start_test_server()
    LOG.info(server_container.server_thread.port % "Server running on %d")
    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)
dataset/ETHPy150Open cloudera/hue/desktop/core/src/desktop/management/commands/test_windmill.py/Command.handle/swapped operands of `%`