Permalink
Browse files

round robin router returned an int, not a list

  • Loading branch information...
1 parent 44439c1 commit 3017bcd508e812121f15755194179465eb996376 @NorthIsUp NorthIsUp committed Feb 17, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 nydus/db/routers/redis.py
  2. +2 −2 tests/test_routers.py
View
2 nydus/db/routers/redis.py
@@ -33,7 +33,7 @@ def get_db(self, cluster, *args, **kwargs):
return []
if not hasattr(self, 'cycler'):
self.cycler = self._get_db__round_robin(cluster)
- return self.cycler.next()
+ return [self.cycler.next()]
class ConsistentHashingRouter(BaseRouter):
View
4 tests/test_routers.py
@@ -66,11 +66,11 @@ def test_cluster_of_zero_returns_zero(self):
def test_cluster_of_one_returns_one(self):
self.cluster.hosts = {0: DummyConnection('foo')}
- tools.assert_items_equal([0], [self.get_db(), ])
+ tools.assert_items_equal([0], self.get_db())
def test_multi_node_cluster_returns_correct_host(self):
self.cluster.hosts = {0: DummyConnection('foo'), 1: DummyConnection('bar')}
- tools.assert_items_equal([0, 1, 0, 1], [self.get_db(), self.get_db(), self.get_db(), self.get_db(), ])
+ tools.assert_items_equal([[0], [1], [0], [1]], [self.get_db(), self.get_db(), self.get_db(), self.get_db(), ])
class InterfaceTest(ConsistentHashingRouterTest):

0 comments on commit 3017bcd

Please sign in to comment.