summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorLuis Pabon <lpabon@redhat.com>2013-05-30 17:31:26 -0400
committerPeter Portante <pportant@redhat.com>2013-06-03 14:15:20 -0700
commit31a2ef1935133f224169a1315a91a2d9e9775d9a (patch)
tree19f187c06ed36052c1520298eb1ea1014422b409 /test
parent50e1660f5bfbb6714d2efcf1e58bd5d0b384b46d (diff)
Remove account name from being saved in the object
Instead we save the account in the a list, where the index to the account is the partition number. Change-Id: Ie4abefee48a3b237306a1e301ffa798e24e3f1db Signed-off-by: Luis Pabon <lpabon@redhat.com> Reviewed-on: http://review.gluster.org/5120 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'test')
-rw-r--r--test/unit/common/test_ring.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/unit/common/test_ring.py b/test/unit/common/test_ring.py
index 8b7509c..4cbb28c 100644
--- a/test/unit/common/test_ring.py
+++ b/test/unit/common/test_ring.py
@@ -53,3 +53,17 @@ class TestRing(unittest.TestCase):
def test_second_device_with_reseller_prefix(self):
part, node = self.ring.get_nodes('AUTH_iops')
assert node[0]['device'] == 'iops'
+
+ def test_partition_id_for_multiple_accounts(self):
+ test_part, test_node = self.ring.get_nodes('test')
+ iops_part, iops_node = self.ring.get_nodes('iops')
+ self.assertNotEqual(test_part, iops_part)
+ self.assertEqual(test_node, self.ring.get_part_nodes(test_part))
+ self.assertEqual(iops_node, self.ring.get_part_nodes(iops_part))
+ self.assertNotEqual(test_node, self.ring.get_part_nodes(iops_part))
+ self.assertNotEqual(iops_node, self.ring.get_part_nodes(test_part))
+
+ def test_invalid_partition(self):
+ nodes = self.ring.get_part_nodes(0)
+ self.assertEqual(nodes[0]['device'], 'volume_not_in_ring')
+