def test_x(): a = Quaternion() assert a.x == 0 a = Quaternion(1, 2, 3) assert a.x == 1 a = Quaternion(4, 5, 6, 1) assert a.x == 4 a = Quaternion(7, 8, 9) a.x = 10 assert a.x == 10 a = Quaternion(11, 12, 13) a.x = 14 assert a.x == 14
def test_properties(): a = Quaternion() a.x = x a.y = y a.z = z a.w = w assert a.x == x, "Check x" assert a.y == y, "Check y" assert a.z == z, "Check z" assert a.w == w, "Check w"
def test_copy(): a = Quaternion(x, y, z, w) b = Quaternion().copy(a) assert b.x == x assert b.y == y assert b.z == z assert b.w == w # ensure that it is a True copy a.x = 0 a.y = -1 a.z = 0 a.w = -1 assert b.x == x assert b.y == y