MCPcopy Create free account
hub / github.com/CompPhysVienna/n2p2 / test_float_initialization

Method test_float_initialization

test/python/test_Vec3D.py:29–38  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

27 assert v.r == [0.0, 0.0, 0.0], ("Empty Vec3D is not initialized "
28 "correctly.")
29 def test_float_initialization(self):
30 v = Vec3D(1.0, 2.0, 3.0)
31 assert isinstance(v, Vec3D), "Can not create Vec3D instance."
32 assert v.r == [1.0, 2.0, 3.0], "Vec3D is not initialized correctly."
33 with pytest.raises(ValueError):
34 Vec3D(1.0)
35 with pytest.raises(ValueError):
36 Vec3D(1.0, 2.0)
37 with pytest.raises(TypeError):
38 Vec3D("a", "b", "c")
39 def test_Vec3D_initialization(self):
40 v = Vec3D(1.0, 2.0, 3.0)
41 w = Vec3D(v)

Callers

nothing calls this directly

Calls 1

Vec3DClass · 0.85

Tested by

no test coverage detected