Permalink
Browse files

some fixes and cleanup in test cases

  • Loading branch information...
1 parent b505740 commit eb5a05501eb3d9ab8098ce32ea451c16919b2c9e @evilkost committed Apr 15, 2011
Showing with 6 additions and 6 deletions.
  1. +6 −6 tests/server_commands.py
View
@@ -66,6 +66,9 @@ def pexpect(self, expected_list, list_without_errors=True):
source_line = '\n' + tb.format_stack()[-2]
def callback(result):
+ if isinstance(result, Exception):
+ self.fail('got exception %s' % result)
+
self.assertEqual(len(result), len(expected_list) )
for result, (exp_e, exp_d) in zip(result, expected_list):
if exp_e:
@@ -82,7 +85,7 @@ def callback(result):
def delayed(self, timeout, cb):
self.loop.add_timeout(time.time()+timeout, cb)
- def finish(self, *args):
+ def finish(self, *args, **kwargs):
self.loop.stop()
def start(self):
@@ -546,6 +549,7 @@ def test_mix_with_pipe(self):
pipe.execute([self.pexpect(['123', {'zar': 'gza'}]), self.finish])
self.start()
+
def test_mix_with_pipe_multi(self):
pipe = self.client.pipeline(transactional=True)
@@ -610,6 +614,7 @@ def test_pipe_zsets(self):
]),
self.finish,
])
+ self.start()
def test_pipe_zsets2(self):
pipe = self.client.pipeline(transactional=False)
@@ -690,14 +695,10 @@ def on_subscription(msg):
self.assertEqual(msg.kind, 'subscribe')
self.assertEqual(msg.channel, 'foo')
self.assertEqual(msg.body, 1)
-
self.client2.listen(on_recv)
self.client2.subscribe('foo', on_subscription)
self.loop.add_timeout(time.time()+0.1, lambda:
- self.client.publish('foo', 'bar', None)
- )
- self.loop.add_timeout(time.time()+0.2, lambda:
self.client.publish('foo', 'bar',
lambda *args:
self.loop.add_timeout(time.time()+0.1, self.finish)
@@ -747,6 +748,5 @@ def test_redis_timeout_with_pipe(self):
)
self.start()
-
if __name__ == '__main__':
unittest.main()

0 comments on commit eb5a055

Please sign in to comment.