Ejemplo n.º 1
0
def test_logging_calls_cherrypy_log_if_verbose_is_true():
    clear_expectations()
    clear()

    ctrl = Controller()
    ctrl.server = Fake('server')
    ctrl.server.context = Fake('context')
    ctrl.server.context.has_attr(settings=Fake('settings'))
    ctrl.server.context.settings.has_attr(Ion=Fake('Ion'))
    ctrl.server.context.settings.Ion.expects('as_bool').with_args('verbose').returns(True)

    ctrl.log('bla')
Ejemplo n.º 2
0
def test_logging_does_nothing_if_verbose_is_false():
    clear_expectations()
    clear()

    ctrl = Controller()
    ctrl.server = Fake('server')
    ctrl.server.context = Fake('context')
    ctrl.server.context.has_attr(settings=Fake('settings'))
    ctrl.server.context.settings.has_attr(Ion=Fake('Ion'))
    ctrl.server.context.settings.Ion.expects('as_bool').with_args('verbose').returns(False)

    ctrl.log('bla')