summaryrefslogtreecommitdiffstats
path: root/test/unit/common/test_ring.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/common/test_ring.py')
-rw-r--r--test/unit/common/test_ring.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/common/test_ring.py b/test/unit/common/test_ring.py
index ca9fc5c..32dd7bb 100644
--- a/test/unit/common/test_ring.py
+++ b/test/unit/common/test_ring.py
@@ -14,6 +14,7 @@
# limitations under the License.
import os
+import errno
import unittest
import gluster.swift.common.constraints
import swift.common.utils
@@ -66,3 +67,15 @@ class TestRing(unittest.TestCase):
def test_invalid_partition(self):
nodes = self.ring.get_part_nodes(0)
self.assertEqual(nodes[0]['device'], 'volume_not_in_ring')
+
+ def test_ring_file_enoent(self):
+ swiftdir = os.path.join(os.getcwd(), "common", "data")
+ try:
+ self.ring = Ring(swiftdir, ring_name='obj')
+ except OSError as ose:
+ if ose.errno == errno.ENOENT:
+ pass
+ else:
+ self.fail('ENOENT expected, %s received.' %ose.errno)
+ else:
+ self.fail('OSError expected.')