testredis.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:edmunds 作者: LowieHuyghe 项目源码 文件源码
def test_redis(self):
        """
        Test the redis
        """

        # Write config
        self.write_config([
            "from edmunds.cache.drivers.redis import Redis \n",
            "APP = { \n",
            "   'cache': { \n",
            "       'enabled': True, \n",
            "       'instances': [ \n",
            "           { \n",
            "               'name': 'redis',\n",
            "               'driver': Redis,\n",
            "               'host': 'localhost',\n",
            "               'port': 6379,\n",
            "               'password': None,\n",
            "               'db': 0,\n",
            "               'default_timeout': 300,\n",
            "               'key_prefix': None,\n",
            "           }, \n",
            "       ], \n",
            "   }, \n",
            "} \n",
            ])

        # Create app
        app = self.create_application()

        driver = app.cache()
        self.assert_is_instance(driver, Redis)
        self.assert_is_instance(driver, RedisCache)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号