##// END OF EJS Templates
s/assert_/assertTrue/
Bradley M. Froehle -
Show More
@@ -97,11 +97,11 b' class TestConfigurable(TestCase):'
97 97 self.assertEqual(c2.config, config)
98 98 self.assertEqual(c3.config, config)
99 99 # Test that copies are not made
100 self.assert_(c1.config is config)
101 self.assert_(c2.config is config)
102 self.assert_(c3.config is config)
103 self.assert_(c1.config is c2.config)
104 self.assert_(c2.config is c3.config)
100 self.assertTrue(c1.config is config)
101 self.assertTrue(c2.config is config)
102 self.assertTrue(c3.config is config)
103 self.assertTrue(c1.config is c2.config)
104 self.assertTrue(c2.config is c3.config)
105 105
106 106 def test_inheritance(self):
107 107 config = Config()
@@ -253,8 +253,8 b' class TestConfig(TestCase):'
253 253 import copy
254 254 c2 = copy.deepcopy(c1)
255 255 self.assertEqual(c1, c2)
256 self.assert_(c1 is not c2)
257 self.assert_(c1.Foo is not c2.Foo)
256 self.assertTrue(c1 is not c2)
257 self.assertTrue(c1.Foo is not c2.Foo)
258 258
259 259 def test_builtin(self):
260 260 c1 = Config()
@@ -9,18 +9,18 b' class TestKernelManager(TestCase):'
9 9 def test_km_lifecycle(self):
10 10 km = MultiKernelManager()
11 11 kid = km.start_kernel()
12 self.assert_(kid in km)
12 self.assertTrue(kid in km)
13 13 self.assertEqual(len(km),1)
14 14 km.kill_kernel(kid)
15 self.assert_(not kid in km)
15 self.assertTrue(not kid in km)
16 16
17 17 kid = km.start_kernel()
18 18 self.assertEqual('127.0.0.1',km.get_kernel_ip(kid))
19 19 port_dict = km.get_kernel_ports(kid)
20 self.assert_('stdin_port' in port_dict)
21 self.assert_('iopub_port' in port_dict)
22 self.assert_('shell_port' in port_dict)
23 self.assert_('hb_port' in port_dict)
20 self.assertTrue('stdin_port' in port_dict)
21 self.assertTrue('iopub_port' in port_dict)
22 self.assertTrue('shell_port' in port_dict)
23 self.assertTrue('hb_port' in port_dict)
24 24 km.get_kernel(kid)
25 25 km.kill_kernel(kid)
26 26
@@ -29,12 +29,12 b' class TestKillRing(unittest.TestCase):'
29 29 """ Does the generic kill ring work?
30 30 """
31 31 ring = KillRing()
32 self.assert_(ring.yank() is None)
33 self.assert_(ring.rotate() is None)
32 self.assertTrue(ring.yank() is None)
33 self.assertTrue(ring.rotate() is None)
34 34
35 35 ring.kill('foo')
36 36 self.assertEqual(ring.yank(), 'foo')
37 self.assert_(ring.rotate() is None)
37 self.assertTrue(ring.rotate() is None)
38 38 self.assertEqual(ring.yank(), 'foo')
39 39
40 40 ring.kill('bar')
@@ -42,8 +42,8 b' class TestKillRing(unittest.TestCase):'
42 42 self.assertEqual(ring.rotate(), 'foo')
43 43
44 44 ring.clear()
45 self.assert_(ring.yank() is None)
46 self.assert_(ring.rotate() is None)
45 self.assertTrue(ring.yank() is None)
46 self.assertTrue(ring.rotate() is None)
47 47
48 48 def test_qt_basic(self):
49 49 """ Does the Qt kill ring work?
@@ -55,7 +55,7 b' class RunnerTestCase(unittest.TestCase):'
55 55 print(repr(ol1))
56 56 print(repr(ol2))
57 57 print('>>>')
58 self.assert_(mismatch==0,'Number of mismatched lines: %s' %
58 self.assertTrue(mismatch==0,'Number of mismatched lines: %s' %
59 59 mismatch)
60 60
61 61 def testIPython(self):
@@ -63,7 +63,7 b' class RunnerTestCase(unittest.TestCase):'
63 63 print(repr(ol1))
64 64 print(repr(ol2))
65 65 print('>>>')
66 self.assert_(mismatch==0,'Number of mismatched lines: %s' %
66 self.assertTrue(mismatch==0,'Number of mismatched lines: %s' %
67 67 mismatch)
68 68
69 69 @decorators.skipif_not_matplotlib
@@ -50,23 +50,23 b' class TestClient(ClusterTestCase):'
50 50 self.assertEqual(v.targets, targets)
51 51 t = self.client.ids[2]
52 52 v = self.client[t]
53 self.assert_(isinstance(v, DirectView))
53 self.assertTrue(isinstance(v, DirectView))
54 54 self.assertEqual(v.targets, t)
55 55 t = self.client.ids[2:4]
56 56 v = self.client[t]
57 self.assert_(isinstance(v, DirectView))
57 self.assertTrue(isinstance(v, DirectView))
58 58 self.assertEqual(v.targets, t)
59 59 v = self.client[::2]
60 self.assert_(isinstance(v, DirectView))
60 self.assertTrue(isinstance(v, DirectView))
61 61 self.assertEqual(v.targets, targets[::2])
62 62 v = self.client[1::3]
63 self.assert_(isinstance(v, DirectView))
63 self.assertTrue(isinstance(v, DirectView))
64 64 self.assertEqual(v.targets, targets[1::3])
65 65 v = self.client[:-3]
66 self.assert_(isinstance(v, DirectView))
66 self.assertTrue(isinstance(v, DirectView))
67 67 self.assertEqual(v.targets, targets[:-3])
68 68 v = self.client[-1]
69 self.assert_(isinstance(v, DirectView))
69 self.assertTrue(isinstance(v, DirectView))
70 70 self.assertEqual(v.targets, targets[-1])
71 71 self.assertRaises(TypeError, lambda : self.client[None])
72 72
@@ -117,11 +117,11 b' class NotificationTests(unittest.TestCase):'
117 117 for i in xrange(10):
118 118 Observer('TYPE', None, center=shared_center)
119 119
120 self.assert_(len(shared_center.observers[('TYPE',None)]) >= 10,
120 self.assertTrue(len(shared_center.observers[('TYPE',None)]) >= 10,
121 121 "observers registered")
122 122
123 123 shared_center.remove_all_observers()
124 self.assert_(len(shared_center.observers) == 0, "observers removed")
124 self.assertTrue(len(shared_center.observers) == 0, "observers removed")
125 125
126 126 def test_any_sender(self):
127 127 expected_ntype = "EXPECTED_TYPE"
@@ -237,9 +237,9 b' class TestHasTraitsNotify(TestCase):'
237 237 a.b = 0.0
238 238 self.assertEqual(len(self._notify1),0)
239 239 a.a = 10
240 self.assert_(('a',0,10) in self._notify1)
240 self.assertTrue(('a',0,10) in self._notify1)
241 241 a.b = 10.0
242 self.assert_(('b',0.0,10.0) in self._notify1)
242 self.assertTrue(('b',0.0,10.0) in self._notify1)
243 243 self.assertRaises(TraitError,setattr,a,'a','bad string')
244 244 self.assertRaises(TraitError,setattr,a,'b','bad string')
245 245 self._notify1 = []
@@ -259,7 +259,7 b' class TestHasTraitsNotify(TestCase):'
259 259 a.a = 0
260 260 self.assertEqual(len(self._notify1),0)
261 261 a.a = 10
262 self.assert_(('a',0,10) in self._notify1)
262 self.assertTrue(('a',0,10) in self._notify1)
263 263 self.assertRaises(TraitError,setattr,a,'a','bad string')
264 264
265 265 def test_subclass(self):
@@ -295,8 +295,8 b' class TestHasTraitsNotify(TestCase):'
295 295 self.assertEqual(len(self._notify2),0)
296 296 b.a = 10
297 297 b.b = 10.0
298 self.assert_(('a',0,10) in self._notify1)
299 self.assert_(('b',0.0,10.0) in self._notify2)
298 self.assertTrue(('a',0,10) in self._notify1)
299 self.assertTrue(('b',0.0,10.0) in self._notify2)
300 300
301 301 def test_static_notify(self):
302 302
@@ -311,7 +311,7 b' class TestHasTraitsNotify(TestCase):'
311 311 # This is broken!!!
312 312 self.assertEqual(len(a._notify1),0)
313 313 a.a = 10
314 self.assert_(('a',0,10) in a._notify1)
314 self.assertTrue(('a',0,10) in a._notify1)
315 315
316 316 class B(A):
317 317 b = Float
@@ -322,8 +322,8 b' class TestHasTraitsNotify(TestCase):'
322 322 b = B()
323 323 b.a = 10
324 324 b.b = 10.0
325 self.assert_(('a',0,10) in b._notify1)
326 self.assert_(('b',0.0,10.0) in b._notify2)
325 self.assertTrue(('a',0,10) in b._notify1)
326 self.assertTrue(('b',0.0,10.0) in b._notify2)
327 327
328 328 def test_notify_args(self):
329 329
@@ -504,11 +504,11 b' class TestInstance(TestCase):'
504 504 inst = Instance(Foo)
505 505
506 506 a = A()
507 self.assert_(a.inst is None)
507 self.assertTrue(a.inst is None)
508 508 a.inst = Foo()
509 self.assert_(isinstance(a.inst, Foo))
509 self.assertTrue(isinstance(a.inst, Foo))
510 510 a.inst = Bar()
511 self.assert_(isinstance(a.inst, Foo))
511 self.assertTrue(isinstance(a.inst, Foo))
512 512 self.assertRaises(TraitError, setattr, a, 'inst', Foo)
513 513 self.assertRaises(TraitError, setattr, a, 'inst', Bar)
514 514 self.assertRaises(TraitError, setattr, a, 'inst', Bah())
@@ -520,7 +520,7 b' class TestInstance(TestCase):'
520 520
521 521 a = A()
522 522 b = A()
523 self.assert_(a.inst is not b.inst)
523 self.assertTrue(a.inst is not b.inst)
524 524
525 525 def test_args_kw(self):
526 526 class Foo(object):
@@ -544,7 +544,7 b' class TestInstance(TestCase):'
544 544 class C(HasTraits):
545 545 inst = Instance(Foo)
546 546 c = C()
547 self.assert_(c.inst is None)
547 self.assertTrue(c.inst is None)
548 548
549 549 def test_bad_default(self):
550 550 class Foo(object): pass
@@ -583,7 +583,7 b' class TestThis(TestCase):'
583 583
584 584 f = Foo()
585 585 f.this = Foo()
586 self.assert_(isinstance(f.this, Foo))
586 self.assertTrue(isinstance(f.this, Foo))
587 587
588 588 def test_subclass(self):
589 589 class Foo(HasTraits):
General Comments 0
You need to be logged in to leave comments. Login now