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>
This commit is contained in:
Mohammed Junaid 2013-05-30 06:20:55 +05:30 committed by Peter Portante
parent dc870d2620
commit 3c0cdd74ec
1 changed files with 3 additions and 3 deletions

View File

@ -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)