From f7819821c71a687a28319d60bb73083b1abd0138 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 31 Dec 2009 19:13:08 +0100 Subject: fixed tc_displayable --- test/tc_displayable.py | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'test') diff --git a/test/tc_displayable.py b/test/tc_displayable.py index d7466809..493b0ef8 100644 --- a/test/tc_displayable.py +++ b/test/tc_displayable.py @@ -4,8 +4,7 @@ import unittest import curses from random import randint -from ranger.gui.displayable import\ - Displayable, DisplayableContainer, OutOfBoundsException +from ranger.gui.displayable import Displayable, DisplayableContainer from test import Fake, OK, raise_ok class TestDisplayable(unittest.TestCase): @@ -38,10 +37,10 @@ class TestDisplayable(unittest.TestCase): disp = self.disp hei, wid = self.env.termsize - self.assertRaises(OutOfBoundsException, disp.resize, 0, 0, hei + 1, wid) - self.assertRaises(OutOfBoundsException, disp.resize, 0, 0, hei, wid + 1) - self.assertRaises(OutOfBoundsException, disp.resize, -1, 0, hei, wid) - self.assertRaises(OutOfBoundsException, disp.resize, 0, -1, hei, wid) + self.assertRaises(ValueError, disp.resize, 0, 0, hei + 1, wid) + self.assertRaises(ValueError, disp.resize, 0, 0, hei, wid + 1) + self.assertRaises(ValueError, disp.resize, -1, 0, hei, wid) + self.assertRaises(ValueError, disp.resize, 0, -1, hei, wid) box = (randint(10, 20), randint(30, 40), \ randint(30, 40), randint(10, 20)) @@ -103,11 +102,14 @@ class TestDisplayableContainer(unittest.TestCase): def test_focused_object(self): d1 = Displayable(**self.initdict) d2 = DisplayableContainer(**self.initdict) - d2.add_child(*[Displayable(**self.initdict) for x in range(5)]) + for obj in (Displayable(**self.initdict) for x in range(5)): + d2.add_child(obj) d3 = DisplayableContainer(**self.initdict) - d3.add_child(*[Displayable(**self.initdict) for x in range(5)]) + for obj in (Displayable(**self.initdict) for x in range(5)): + d3.add_child(obj) - self.disc.add_child(d1, d2, d3) + for obj in (d1, d2, d3): + self.disc.add_child(obj) d3.container[3].focused = True -- cgit 1.4.1-2-gfad0