summary refs log tree commit diff stats
path: root/examples/plugin_chmod_keybindings.py
diff options
context:
space:
mode:
authorhut <hut@lepus.uberspace.de>2016-04-06 23:08:15 +0200
committerhut <hut@lepus.uberspace.de>2016-04-06 23:08:15 +0200
commitdca32e29fd3df1ccb3b5cbcf3e39facbd70bb634 (patch)
tree47396781f96a7713cea682eb325ec35ba09db140 /examples/plugin_chmod_keybindings.py
parent3d5f27cd4d53930725203bb334cbdcb642718444 (diff)
downloadranger-dca32e29fd3df1ccb3b5cbcf3e39facbd70bb634.tar.gz
Revert "core.linemode: Changed timestamp formatting in mtime linemode"
This reverts commit 4dcbb42adaf42e9c154ac3011ddedec2793c090a.
Diffstat (limited to 'examples/plugin_chmod_keybindings.py')
0 files changed, 0 insertions, 0 deletions
a id='n13' href='#n13'>13 14 15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65














                                                                       














                                                            
                                                                           


                                               
                                                         






                                         






















                                                                         
# 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, commandlist=Fake())

		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()