summary refs log tree commit diff stats
path: root/test/tc_history.py
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-09-16 18:19:46 +0200
committerhut <hut@lavabit.com>2010-09-16 18:19:46 +0200
commit4341846741b6623a1ead43485cfd5cf633453bb6 (patch)
treefdfdd0b13329ad457ad9a6a0c0091019396ae64a /test/tc_history.py
parent37a60686b340f030a2fc37e7ac9d19a701de9e6b (diff)
parent0c0849c3d8bf57a8b0d0bd9d6113639c58a28fd2 (diff)
downloadranger-4341846741b6623a1ead43485cfd5cf633453bb6.tar.gz
Merge branch 'master' into cp
Conflicts:
	ranger/__main__.py
	ranger/core/actions.py
Diffstat (limited to 'test/tc_history.py')
-rw-r--r--test/tc_history.py33
1 files changed, 28 insertions, 5 deletions
diff --git a/test/tc_history.py b/test/tc_history.py
index d027231a..02a8bb9f 100644
--- a/test/tc_history.py
+++ b/test/tc_history.py
@@ -13,7 +13,11 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-if __name__ == '__main__': from __init__ import init; init()
+import os.path
+import sys
+rangerpath = os.path.join(os.path.dirname(__file__), '..')
+if sys.path[1] != rangerpath:
+	sys.path[1:1] = [rangerpath]
 
 from ranger.container import History
 from unittest import TestCase, main
@@ -29,13 +33,13 @@ class Test(TestCase):
 		hist.back()
 
 		self.assertEqual(4, hist.current())
-		self.assertEqual([3,4], list(hist))
+		self.assertEqual([3,4], list(hist._left()))
 
 		self.assertEqual(5, hist.top())
 
 		hist.back()
 		self.assertEqual(3, hist.current())
-		self.assertEqual([3], list(hist))
+		self.assertEqual([3], list(hist._left()))
 
 		# no change if current == bottom
 		self.assertEqual(hist.current(), hist.bottom())
@@ -48,12 +52,31 @@ class Test(TestCase):
 		hist.forward()
 		hist.forward()
 		self.assertEqual(5, hist.current())
-		self.assertEqual([3,4,5], list(hist))
+		self.assertEqual([3,4,5], list(hist._left()))
 
 
 		self.assertEqual(3, hist.bottom())
 		hist.add(6)
 		self.assertEqual(4, hist.bottom())
-		self.assertEqual([4,5,6], list(hist))
+		self.assertEqual([4,5,6], list(hist._left()))
+
+		hist.back()
+		hist.fast_forward()
+		self.assertEqual([4,5,6], list(hist._left()))
+		hist.back()
+		hist.back()
+		hist.fast_forward()
+		self.assertEqual([4,5,6], list(hist._left()))
+		hist.back()
+		hist.back()
+		hist.back()
+		hist.fast_forward()
+		self.assertEqual([4,5,6], list(hist._left()))
+		hist.back()
+		hist.back()
+		hist.back()
+		hist.back()
+		hist.fast_forward()
+		self.assertEqual([4,5,6], list(hist._left()))
 
 if __name__ == '__main__': main()