def test_setitem(self): vec1 = Vector([4, 2, 1, 5]) vec1[2] = 10 self.assertListEqual(vec1.get(), [4, 2, 10, 5]) vec2 = Vector([1, 2, 3]) vec2[5] = 7 self.assertListEqual(vec2.get(), [1, 2, 3, 0, 0, 7])
def test_get(self): arr = [3, 4, 5] vec = Vector(arr) self.assertEqual(vec.get(), arr)