about summary refs log tree commit diff stats
path: root/WWW/Library/Implementation/HTVMS_WaisProt.c
Commit message (Expand)AuthorAgeFilesLines
* snapshot of project "lynx", label v2-8-8dev_11Thomas E. Dickey2012-02-201-0/+2469
* snapshot of project "lynx", label v2-8-8dev_10bThomas E. Dickey2012-02-201-2469/+0
* snapshot of project "lynx", label v2-8-8dev_8mThomas E. Dickey2011-06-111-0/+2469
* snapshot of project "lynx", label v2_8_8dev_9aThomas E. Dickey2011-06-111-2469/+0
* snapshot of project "lynx", label v2-8-8dev_5eThomas E. Dickey2010-09-261-7/+7
* snapshot of project "lynx", label v2-8-8dev_3cThomas E. Dickey2010-05-031-0/+2469
* snapshot of project "lynx", label v2_8_8dev_6cThomas E. Dickey2010-04-291-2467/+0
* snapshot of project "lynx", label v2-8-6dev_3Thomas E. Dickey2004-05-071-1831/+1796
* snapshot of project "lynx", label v2-8-6dev_2Thomas E. Dickey2004-04-271-10/+10
* snapshot of project "lynx", label v2-8-5dev_17Thomas E. Dickey2004-01-081-423/+423
* snapshot of project "lynx", label v2-8-3dev_19Thomas E. Dickey2000-02-151-1/+3
* snapshot of project "lynx", label v2-8-2dev_2Thomas E. Dickey1998-11-101-41/+40
* snapshot of project "lynx", label v2-8-1dev_4Thomas E. Dickey1998-11-061-40/+41
* snapshot of project "lynx", label v2-8-1dev_20Thomas E. Dickey1998-08-061-41/+40
* snapshot of project "lynx", label v2-8-1dev_5Thomas E. Dickey1998-03-291-5/+5
* snapshot of project "lynx", label v2_6Thomas E. Dickey1996-09-021-0/+2501
class="highlight">
# Copyright (C) 2009, 2010  Roman Zimbelmann <romanz@lavabit.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# 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 unittest
import curses

from ranger.gui import ui

from test import Fake, OK, raise_ok

ui.curses = Fake()

class Test(unittest.TestCase):
	def setUp(self):

		self.fm = Fake()
		self.ui = ui.UI(env=Fake(), fm=self.fm)

		def fakesetup():
			self.ui.widget = Fake()
			self.ui.add_child(self.ui.widget)
		self.ui.setup = fakesetup

		self.ui.initialize()

	def tearDown(self):
		self.ui.destroy()
	
	def test_passing(self):
		# Test whether certain method calls are passed to widgets
		widget = self.ui.widget

		widget.draw = raise_ok
		self.assertRaises(OK, self.ui.draw)
		widget.__clear__()

		widget.finalize = raise_ok
		self.assertRaises(OK, self.ui.finalize)
		widget.__clear__()

		widget.press = raise_ok
		random_key = 123
		self.assertRaises(OK, self.ui.handle_key, random_key)
		widget.__clear__()

		widget.destroy = raise_ok
		self.assertRaises(OK, self.ui.destroy)
		widget.__clear__()

if __name__ == '__main__':
	unittest.main()