def test_DumpToString(self) -> None: """some objects can be serialized to a string""" v = math_Vector(0, 2) serialized_v = v.DumpToString() # should output expected_output = "math_Vector of Length = 3\nmath_Vector(0) = 0\nmath_Vector(1) = 0\nmath_Vector(2) = 0\n" self.assertEqual(expected_output, serialized_v)
def __init__(self): plotocc.__init__(self) self.compound = TopoDS_Compound() self.builder = BRep_Builder() self.builder.MakeCompound(self.compound) mmat = math_Matrix(1, 4, 1, 3, 0.0) mmat.SetDiag(1.0) print(mmat.Determinant()) print(mmat.DumpToString()) mvec = math_Vector(1, 3) print(mvec.Norm()) print(mvec.DumpToString())