Example #1
0
        host=config.HOST,
        port=config.PORT,
        check_url=config.HOST_ALIAS,
    ),
    'Flask':
    liveandletdie.Flask(
        os.path.join(EXAMPLES_DIR, 'flask/functional_test/main.py'),
        host=config.HOST,
        port=config.PORT,
        check_url=config.HOST_ALIAS,
        ssl=True,
    ),
    'Pyramid':
    liveandletdie.WsgirefSimpleServer(os.path.join(
        EXAMPLES_DIR, 'pyramid/functional_test/main.py'),
                                      host=config.HOST,
                                      port=config.PORT,
                                      check_url=config.HOST_ALIAS),
}

APPS = dict((k, v) for k, v in ALL_APPS.items()
            if k.lower() in config.INCLUDE_FRAMEWORKS)

file_handler = logging.FileHandler(LOG_PATH, mode='w')
file_handler.setFormatter(logging.Formatter('%(asctime)s %(message)s',
                                            '%x %X'))

logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
logger.addHandler(file_handler)
Example #2
0
class TestPyramidSSL(unittest.TestCase):
    EXPECTED_TEXT = 'Home Pyramid SSL'
    app = liveandletdie.WsgirefSimpleServer(abspath('sample_apps/pyramid/main.py'), port=PORT,
                                            ssl=True)
Example #3
0
from os import path, environ
import sys

import liveandletdie
import pytest
import requests


def abspath(pth):
    return path.join(path.dirname(__file__), '../..', pth)


PORT = 8001
APPS = {
    'Pyramid':
    liveandletdie.WsgirefSimpleServer(abspath('sample_apps/pyramid/main.py'),
                                      port=PORT),
    'Pyramid SSL':
    liveandletdie.WsgirefSimpleServer(abspath('sample_apps/pyramid/main.py'),
                                      port=PORT,
                                      ssl=True),
    'Flask':
    liveandletdie.Flask(abspath('sample_apps/flask/main.py'), port=PORT),
    'Flask SSL':
    liveandletdie.Flask(abspath('sample_apps/flask/main.py'),
                        port=PORT,
                        ssl=True),
    'Django':
    liveandletdie.Django(abspath('sample_apps/django/example'), port=PORT),
}

if sys.version_info[0] is 2 and sys.version_info[1] is 7: