about summary refs log tree commit diff stats
path: root/themes
Commit message (Expand)AuthorAgeFilesLines
* Updated themes with roommention settingJames Booth2014-07-175-0/+5
* Colour chat room messages that contain users nicknameJames Booth2014-07-161-0/+1
* Changed input text to green boothj5 themeJames Booth2014-05-231-1/+1
* Added themes supplied by p41nm47r1xJames Booth2014-04-114-0/+144
* Added otr settings to themesJames Booth2014-03-286-0/+54
* Added boothj5 themeJames Booth2013-01-171-0/+27
* Changed theme propertiesJames Booth2012-12-037-52/+52
* Added time to themes, and some example themesJames Booth2012-11-227-0/+139
41 42 43 44




                                                         
                                    





































                                                           
if __name__ == '__main__':
	from os.path import abspath, join
	import sys
	sys.path.append(abspath(join(sys.path[0], '..')))

from ranger.container import History
from unittest import TestCase, main
import unittest

class Test(TestCase):
	def test_everything(self):
		hist = History(3)
		for i in range(6):
			hist.add(i)
		self.assertEqual([3,4,5], list(hist))

		hist.back()

		self.assertEqual(4, hist.top())
		self.assertEqual([3,4], list(hist))

		hist.back()
		self.assertEqual(3, hist.top())
		self.assertEqual([3], list(hist))

		# no change if top == bottom
		self.assertEqual(hist.top(), hist.bottom())
		last_top = hist.top()
		hist.back()
		self.assertEqual(hist.top(), last_top)


		hist.forward()
		hist.forward()
		self.assertEqual(5, hist.top())
		self.assertEqual([3,4,5], list(hist))


		self.assertEqual(3, hist.bottom())
		hist.add(6)
		self.assertEqual(4, hist.bottom())
		self.assertEqual([4,5,6], list(hist))

if __name__ == '__main__': main()