From fc4f6feb8f769aac8f62afb6fdedac86262c2c26 Mon Sep 17 00:00:00 2001 From: David Goetz Date: Wed, 31 Aug 2011 07:28:36 -0700 Subject: [PATCH] fix for unit test --- test/unit/obj/test_auditor.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/test/unit/obj/test_auditor.py b/test/unit/obj/test_auditor.py index 9b629ff764..cc08c2cd60 100644 --- a/test/unit/obj/test_auditor.py +++ b/test/unit/obj/test_auditor.py @@ -325,13 +325,15 @@ class TestAuditor(unittest.TestCase): DiskFile.close(self, verify_file=verify_file) self.setup_bad_zero_byte() was_df = object_server.DiskFile - object_server.DiskFile = FakeFile - self.auditor.run_once(zero_byte_fps=50) - quarantine_path = os.path.join(self.devices, - 'sda', 'quarantined', 'objects') - self.assertTrue(os.path.isdir(quarantine_path)) - self.assertTrue(rat[0]) - object_server.DiskFile = was_df + try: + object_server.DiskFile = FakeFile + self.auditor.run_once(zero_byte_fps=50) + quarantine_path = os.path.join(self.devices, + 'sda', 'quarantined', 'objects') + self.assertTrue(os.path.isdir(quarantine_path)) + self.assertTrue(rat[0]) + finally: + object_server.DiskFile = was_df def test_run_forever(self):