diff --git a/redis/test.py b/redis/test.py index b3257b7..716fdb1 100644 --- a/redis/test.py +++ b/redis/test.py @@ -25,9 +25,17 @@ def test(): self.app({'PATH_INFO':'/', 'REQUEST_METHOD':'GET'}, lambda x, y: None) @self.app.get('/2') - def test(**kw): + def test_kw(**kw): self.assertFalse('rdb' in kw) self.app({'PATH_INFO':'/2', 'REQUEST_METHOD':'GET'}, lambda x, y: None) + + def test_optional_args(self): + self.plugin = self.app.install(redis_plugin.Plugin(database=1)) + + @self.app.get('/db/1') + def test_db_arg(rdb): + self.assertTrue(rdb.connection_pool.connection_kwargs['db'] == 1) + self.app({'PATH_INFO':'/db/1', 'REQUEST_METHOD':'GET'}, lambda x,y: None) if __name__ == '__main__': unittest.main()