def should_initialize_logging():
    log_statement = "some log statement"
    test_config_file = "src/unittest/resources/pypiproxy_unittest.cfg"
    log_file = Configuration(test_config_file).log_file
    try:
        os.remove(log_file)
    except:
        pass


    initialize(test_config_file)
    pypiproxy_logger = logging.getLogger("pypiproxy")
    pypiproxy_logger.info(log_statement)


    assert_that(log_file).is_a_file()
    with open(log_file) as file_stream:
        assert_that(file_stream.read()).contains(log_statement)
Ejemplo n.º 2
0
#!/usr/bin/env python

import socket
from pypiproxy.webapp import application
from pypiproxy import initialize

initialize("/etc/pypiproxy/pypiproxy.cfg")
application.run(host=socket.getfqdn())
Ejemplo n.º 3
0
#!/usr/bin/env python

import sys

sys.path.append('src/main/python')

from pypiproxy.webapp import application
from pypiproxy import initialize

initialize("./pypiproxy.cfg")
application.run(debug=True)