예제 #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")
예제 #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'
예제 #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")
예제 #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")
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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()
예제 #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'