Пример #1
0
try:
    import xmlrpc.client as xmlrpclib
except ImportError:
    import xmlrpclib  # legacy Python

# Third party imports
import pytest
import webtest

# Local Imports
from pypiserver import __main__, bottle
import tests.test_core as test_core

# Enable logging to detect any problems with it
##
__main__.init_logging(level=logging.NOTSET)
hp = HTMLParser()


@pytest.fixture()
def _app(app):
    return app.module


@pytest.fixture
def app(tmpdir):
    from pypiserver import app
    return app(root=tmpdir.strpath, authenticated=[])


@pytest.fixture
Пример #2
0
import contextlib
import glob
import logging
import os
import subprocess

import pytest
import webtest

from pypiserver import __main__, bottle


# Enable logging to detect any problems with it
##
__main__.init_logging(level=logging.NOTSET)


@pytest.fixture()
def _app(app):
    return app.module


@pytest.fixture
def app(tmpdir):
    from pypiserver import app
    return app(root=tmpdir.strpath, authenticated=[])


@pytest.fixture
def testapp(app):
Пример #3
0
def test_init_logging_with_none_stream_doesnt_add_stream_handler(dummy_logger):
    assert not dummy_logger.handlers

    __main__.init_logging(stream=None, logger=dummy_logger)
    assert not dummy_logger.handlers
Пример #4
0
    import xmlrpc.client as xmlrpclib
except ImportError:
    import xmlrpclib  # legacy Python

# Third party imports
import pytest
import webtest

# Local Imports
from pypiserver import __main__, bottle

import tests.test_core as test_core

# Enable logging to detect any problems with it
##
__main__.init_logging()


@pytest.fixture()
def _app(app):
    return app.module


@pytest.fixture
def app(tmpdir):
    from pypiserver import app

    return app(root=tmpdir.strpath, authenticated=[])


@pytest.fixture
Пример #5
0
def test_init_logging_with_stream(dummy_logger):
    assert not dummy_logger.handlers

    __main__.init_logging(stream=sys.stdout, logger=dummy_logger)
    assert isinstance(dummy_logger.handlers[0], logging.StreamHandler)
    assert dummy_logger.handlers[0].stream is sys.stdout