def setUpBench(self):
        logging.disable('INFO')
        client = AppTestClient()
        start_app_test_client(client)
        client.listenTCP()
        proxy = Proxy(proxy_port='8889', app_port='4567')

        # setup data
        client.add_multiple_to_mailbox(10,
                                       'INBOX',
                                       to='*****@*****.**',
                                       cc='*****@*****.**',
                                       bcc='*****@*****.**')
        client.add_multiple_to_mailbox(10,
                                       'TRASH',
                                       to='*****@*****.**',
                                       cc='*****@*****.**',
                                       bcc='*****@*****.**')
        client.add_multiple_to_mailbox(10,
                                       'DRAFTS',
                                       to='*****@*****.**',
                                       cc='*****@*****.**',
                                       bcc='*****@*****.**')

        self.call_to_terminate = proxy.run_on_a_thread()
Example #2
0
def before_all(context):
    logging.disable('INFO')
    client = AppTestClient()
    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')
Example #3
0
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()
Example #4
0
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()
    def setUpBench(self):
        client = AppTestClient()
        start_app_test_client(client)
        client.listenTCP()
        proxy = Proxy(proxy_port='8889', app_port='4567')

        # setup data
        client.add_multiple_to_mailbox(10, 'INBOX', to='*****@*****.**', cc='*****@*****.**', bcc='*****@*****.**')
        client.add_multiple_to_mailbox(10, 'TRASH', to='*****@*****.**', cc='*****@*****.**', bcc='*****@*****.**')
        client.add_multiple_to_mailbox(10, 'DRAFTS', to='*****@*****.**', cc='*****@*****.**', bcc='*****@*****.**')

        self.call_to_terminate = proxy.run_on_a_thread()
def before_all(context):
    ensure_server()
    logging.disable('INFO')
    PixelatedSite.disable_csp_requests()
    client = AppTestClient()
    start_app_test_client(client, UserAgentMode(is_single_user=True))
    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()

    multi_user_client = AppTestClient()
    start_app_test_client(multi_user_client, UserAgentMode(is_single_user=False))
    multi_user_client.listenTCP(port=MULTI_USER_PORT)
    context.multi_user_client = multi_user_client
Example #7
0
#
# Copyright (c) 2014 ThoughtWorks Deutschland GmbH
#
# Pixelated is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Pixelated is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with Pixelated. If not, see <http://www.gnu.org/licenses/>.

from test.support.dispatcher.proxy import Proxy

if __name__ in ('main', '__main__'):
    proxy = Proxy(proxy_port='8888', app_port='3333')
    try:
        proxy.serve_forever()
    except Exception, e:
        proxy.shutdown()