From e5a557a72ebb461abee7f5e255d69aaccd875d0e Mon Sep 17 00:00:00 2001 From: holys Date: Tue, 1 Jul 2014 21:26:31 +0800 Subject: [PATCH] add server information commands test cases --- client/ledis-py/tests/test_others.py | 31 ++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 client/ledis-py/tests/test_others.py diff --git a/client/ledis-py/tests/test_others.py b/client/ledis-py/tests/test_others.py new file mode 100644 index 0000000..d57d332 --- /dev/null +++ b/client/ledis-py/tests/test_others.py @@ -0,0 +1,31 @@ +# coding: utf-8 +# Test Cases for other commands + +import unittest +import sys +sys.path.append('..') + +import ledis +from ledis._compat import b +from ledis import ResponseError + +l = ledis.Ledis(port=6380) + +class TestOtherCommands(unittest.TestCase): + def setUp(self): + pass + + def tearDown(self): + pass + + # server information + def test_echo(self): + assert l.echo('foo bar') == b('foo bar') + + def test_ping(self): + assert l.ping() + + def test_select(self): + assert l.select('1') + assert l.select('15') + self.assertRaises(ResponseError, lambda: l.select('16')) \ No newline at end of file