add server information commands test cases

This commit is contained in:
holys 2014-07-01 21:26:31 +08:00
parent 20ebfeafc2
commit e5a557a72e
1 changed files with 31 additions and 0 deletions

View File

@ -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'))