def test_create_list(self): with self.assertRaises(ValueError): vector4.create([1., 2., 3., 4.])
def test_create_values(self): result = vector4.create(1.,2.,3.,4., dtype=np.float32) np.testing.assert_almost_equal(result, [1.,2.,3.,4.], decimal=5) self.assertTrue(result.dtype == np.float32)
def test_create(self): result = vector4.create() np.testing.assert_almost_equal(result, [0.,0.,0.,0.], decimal=5) self.assertTrue(result.dtype == np.float)
def test_create_values(self): result = vector4.create(1., 2., 3., 4., dtype=np.float32) np.testing.assert_almost_equal(result, [1., 2., 3., 4.], decimal=5) self.assertTrue(result.dtype == np.float32)
def test_create(self): result = vector4.create() np.testing.assert_almost_equal(result, [0., 0., 0., 0.], decimal=5) self.assertTrue(result.dtype == np.float)