From 5dd256d5d5295dd889a4bf652561e0523e70aed9 Mon Sep 17 00:00:00 2001 From: Folker Bernitt Date: Wed, 29 Jul 2015 11:03:18 +0200 Subject: Fixed all functional tests using crochet. - Issue #420 - Added crochet as a test dependency - crochet now executes twisted in same process, in a background thread --- service/test/functional/features/environment.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'service/test/functional/features/environment.py') diff --git a/service/test/functional/features/environment.py b/service/test/functional/features/environment.py index 437529b8..4967a356 100644 --- a/service/test/functional/features/environment.py +++ b/service/test/functional/features/environment.py @@ -16,6 +16,9 @@ import logging import uuid +from crochet import setup, wait_for +setup() + from test.support.dispatcher.proxy import Proxy from test.support.integration import AppTestClient from selenium import webdriver @@ -23,18 +26,23 @@ from selenium import webdriver from pixelated.resources.features_resource import FeaturesResource +@wait_for(timeout=5.0) +def start_app_test_client(client): + return client.start_client() + + def before_all(context): logging.disable('INFO') client = AppTestClient() + start_app_test_client(client) + client.listenTCP() proxy = Proxy(proxy_port='8889', app_port='4567') FeaturesResource.DISABLED_FEATURES.append('autoRefresh') context.client = client context.call_to_terminate_proxy = proxy.run_on_a_thread() - context.call_to_terminate = client.run_on_a_thread(logfile='/tmp/behave-tests.log') def after_all(context): - context.call_to_terminate() context.call_to_terminate_proxy() -- cgit v1.2.3