summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--test/tc_ext.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/test/tc_ext.py b/test/tc_ext.py
index 2ee4a407..c57d4aa8 100644
--- a/test/tc_ext.py
+++ b/test/tc_ext.py
@@ -75,14 +75,17 @@ class TestCases(unittest.TestCase):
 			return depth <= 1
 
 		from ranger.ext import mount_path
+		original_ismount = mount_path.ismount
 		mount_path.ismount = my_ismount
-
-		mp = mount_path.mount_path
-
-		self.assertEqual('/home', mp('/home/hut/porn/bondage'))
-		self.assertEqual('/', mp('/'))
-		self.assertEqual('/media/sdb1', mp('/media/sdb1/foo/bar'))
-		self.assertEqual('/media/sdc2', mp('/media/sdc2/a/b/c/d/e'))
+		try:
+			mp = mount_path.mount_path
+
+			self.assertEqual('/home', mp('/home/hut/porn/bondage'))
+			self.assertEqual('/', mp('/'))
+			self.assertEqual('/media/sdb1', mp('/media/sdb1/foo/bar'))
+			self.assertEqual('/media/sdc2', mp('/media/sdc2/a/b/c/d/e'))
+		finally:
+			mount_path.ismount = original_ismount
 
 		# TODO: links are not tested but I don't see how its possible
 		# without messing around with mounts.