test for method component
(self)
| 13 | |
| 14 | class Test(unittest.TestCase): |
| 15 | def test_component(self): |
| 16 | """ |
| 17 | test for method component |
| 18 | """ |
| 19 | x = Vector([1,2,3]) |
| 20 | self.assertEqual(x.component(0),1) |
| 21 | self.assertEqual(x.component(2),3) |
| 22 | try: |
| 23 | y = Vector() |
| 24 | self.assertTrue(False) |
| 25 | except: |
| 26 | self.assertTrue(True) |
| 27 | def test_str(self): |
| 28 | """ |
| 29 | test for toString() method |