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