Exemplo n.º 1
0
 def test_debug_mode(self):
     app = Zask(__name__)
     app.config = self.default_config
     app.logger.debug("debug")
     app.logger.info("info")
     app.logger.error("error")
     app.logger.exception("exception")
Exemplo n.º 2
0
 def test_default_config(self):
     clear_handlers()
     app = Zask(__name__)
     app.config = {
         "DEBUG": True,
         "ERROR_LOG": ""
     }
     init_zerorpc(app)
     assert app.config['ZERORPC_ACCESS_LOG'] == '/tmp/zerorpc.access.log'
Exemplo n.º 3
0
    def test_debug_mode(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        init_zerorpc(app)

        print ""
        channel_logger.error("error")
        gevent_logger.error("error")
        core_logger.error("error")
Exemplo n.º 4
0
    def test_debug_mode(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        init_zerorpc(app)

        print ""
        channel_logger.error("error")
        gevent_logger.error("error")
        core_logger.error("error")
Exemplo n.º 5
0
    def test_access_log(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        init_zerorpc(app)

        @access_log
        class MySrv(object):
            def sleep(self):
                time.sleep(1)

        srv = MySrv()
        print "Should print an access log:"
        srv.sleep()
Exemplo n.º 6
0
    def test_access_log(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        init_zerorpc(app)

        @access_log
        class MySrv(object):
            def sleep(self):
                time.sleep(1)

        srv = MySrv()
        print "Should print an access log:"
        srv.sleep()
Exemplo n.º 7
0
    def test_prod_mode(self):
        app = Zask(__name__)
        app.config = self.default_config
        app.config['DEBUG'] = False
        app.config['PRODUCTION_LOGGING_LEVEL'] = 'warning'
        app.logger.debug("debug")
        app.logger.info("info")
        app.logger.warning("warning")
        app.logger.error("error")
        app.logger.exception("exception")

        print ''
        print 'printing file:'
        with open(app.config['ERROR_LOG'], 'r') as fin:
            print fin.read()
Exemplo n.º 8
0
    def test_prod_mode(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        app.config['DEBUG'] = False
        init_zerorpc(app)

        channel_logger.error("error")
        gevent_logger.error("error")
        core_logger.error("error")

        print ""
        print "printing file:"
        with open(app.config['ERROR_LOG'], 'r') as fin:
            print fin.read()
Exemplo n.º 9
0
    def test_prod_mode(self):
        clear_handlers()
        app = Zask(__name__)
        app.config = self.default_config
        app.config['DEBUG'] = False
        init_zerorpc(app)

        channel_logger.error("error")
        gevent_logger.error("error")
        core_logger.error("error")

        print ""
        print "printing file:"
        with open(app.config['ERROR_LOG'], 'r') as fin:
            print fin.read()
Exemplo n.º 10
0
 def test_default_config(self):
     clear_handlers()
     app = Zask(__name__)
     app.config = {"DEBUG": True, "ERROR_LOG": ""}
     init_zerorpc(app)
     assert app.config['ZERORPC_ACCESS_LOG'] == '/tmp/zerorpc.access.log'