'Verify the output of a server task.'

def verify_run_all_servers_task(self, options):

    log_string = options.get('log_string', '>    /dev/null')
    settings = options.get('settings', None)
    asset_settings = options.get('asset_settings', None)
    is_optimized = options.get('optimized', False)
    is_fast = options.get('fast', False)
    self.reset_task_messages()
    call_task('pavelib.servers.run_all_servers', options=options)
    expected_settings = (settings if settings else Env.DEVSTACK_SETTINGS)
    expected_asset_settings = (asset_settings if asset_settings else expected_settings)
    if is_optimized:
        expected_settings = 'devstack_optimized'
        expected_asset_settings = 'test_static_optimized'
    expected_collect_static = ((not is_fast) and (expected_settings != Env.DEVSTACK_SETTINGS))
    expected_messages = []
    if (not is_fast):
        expected_messages.append(u'xmodule_assets    common/static/xmodule')
        expected_messages.append(u'install    npm_assets')
        expected_messages.append(EXPECTED_COFFEE_COMMAND.format(platform_root=self.platform_root))
        expected_messages.extend([c.format(settings=expected_asset_settings) for c in EXPECTED_PRINT_SETTINGS_COMMAND])
        expected_messages.append(EXPECTED_WEBPACK_COMMAND.format(node_env=('production' if (expected_asset_settings != Env.DEVSTACK_SETTINGS) else 'development'), static_root_lms=None, static_root_cms=None))
        expected_messages.extend(self.expected_sass_commands(asset_settings=expected_asset_settings))
    if expected_collect_static:
        expected_messages.append(EXPECTED_COLLECT_STATIC_COMMAND.format(system='lms', asset_settings=expected_asset_settings, log_string=log_string))
        expected_messages.append(EXPECTED_COLLECT_STATIC_COMMAND.format(system='cms', asset_settings=expected_asset_settings, log_string=log_string))
    expected_messages.append(EXPECTED_RUN_SERVER_COMMAND.format(system='lms', settings=expected_settings, port=8000))
    expected_messages.append(EXPECTED_RUN_SERVER_COMMAND.format(system='cms', settings=expected_settings, port=8001))
    expected_messages.append(EXPECTED_CELERY_COMMAND.format(settings='devstack_with_worker'))
    self.assertEquals(self.task_messages, expected_messages)
