Show More
@@ -411,6 +411,18 b' class TestHasTraits(TestCase):' | |||
|
411 | 411 | self.assertEqual(a.i, 1) |
|
412 | 412 | self.assertEqual(a.x, 10.0) |
|
413 | 413 | |
|
414 | def test_positional_args(self): | |
|
415 | class A(HasTraits): | |
|
416 | i = Int(0) | |
|
417 | def __init__(self, i): | |
|
418 | super(A, self).__init__() | |
|
419 | self.i = i | |
|
420 | ||
|
421 | a = A(5) | |
|
422 | self.assertEqual(a.i, 5) | |
|
423 | # should raise TypeError if no positional arg given | |
|
424 | self.assertRaises(TypeError, A) | |
|
425 | ||
|
414 | 426 | #----------------------------------------------------------------------------- |
|
415 | 427 | # Tests for specific trait types |
|
416 | 428 | #----------------------------------------------------------------------------- |
General Comments 0
You need to be logged in to leave comments.
Login now