summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMohammed Junaid <junaid@redhat.com>2013-05-30 06:20:55 +0530
committerPeter Portante <pportant@redhat.com>2013-05-30 10:51:22 -0700
commit3c0cdd74ec1d8df3e452a6653f20bad6252b971c (patch)
treebe9e84707d9381955db020f9186aaad9798c5113 /test/unit
parentdc870d2620a2f10c6b00589d4d06fe2feb7c329b (diff)
Moved closing of fd1 to the inner try block in the test_do_write_err function.
This is a follow up change to the previous commit to fs_utils unit test case patch. Change-Id: I677683677071efc6176ad2145d1806bc7e658c9e Signed-off-by: Mohammed Junaid <junaid@redhat.com> Reviewed-on: http://review.gluster.org/5116 Reviewed-by: Peter Portante <pportant@redhat.com> Tested-by: Peter Portante <pportant@redhat.com>
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/common/test_fs_utils.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit/common/test_fs_utils.py b/test/unit/common/test_fs_utils.py
index eb6faa0..559c7db 100644
--- a/test/unit/common/test_fs_utils.py
+++ b/test/unit/common/test_fs_utils.py
@@ -87,7 +87,7 @@ class TestFsUtils(unittest.TestCase):
except OSError:
pass
else:
- self.fail("IOError expected")
+ self.fail("OSError expected")
def test_do_write(self):
fd, tmpfile = mkstemp()
@@ -108,10 +108,10 @@ class TestFsUtils(unittest.TestCase):
pass
else:
self.fail("OSError expected")
+ finally:
+ os.close(fd1)
except OSError as ose:
self.fail("Open failed with %s" %ose.strerror)
- else:
- os.close(fd1)
finally:
os.close(fd)
os.remove(tmpfile)