示例#1
0
def test_deserialize_point_twice():
    cortopy.eval(
"""
struct PointB::
    x, y: int64
"""
    )
    Point1 = cortopy.gettype("PointB")
    Point2 = cortopy.gettype("PointB")
    assert Point1 == Point2
示例#2
0
def test_deserialize_point_once():
    cortopy.eval(
"""
struct PointA::
    x, y: int64
"""
    )
    Point = cortopy.gettype("PointA")
示例#3
0
def Line4d(Point3d):
    cortopy.eval(
"""
struct Line4d::
    a, b: Point4d
"""
    )
    t = cortopy.gettype("Line4d")
    return t
示例#4
0
def Point4d(Point3d):
    cortopy.eval(
"""
struct Point4d: Point3d::
    w: int64
"""
    )
    t = cortopy.gettype("Point4d")
    return t
示例#5
0
def Point3d():
    cortopy.eval(
"""
struct Point3d::
    x, y, z: int64
"""
    )
    t = cortopy.gettype("Point3d")
    return t
示例#6
0
def test_serializeType():
    a = cortopy.gettype("bool")
示例#7
0
def test_int8_mro(name):
    int8 = cortopy.gettype("int8")
    assert int8.__mro__ == (cortopy.types["int8"], cortopy.object, object)
示例#8
0
def test_int8_type_and_superclass(name):
    int8 = cortopy.gettype("int8")
    assert isinstance(int8, type)
    assert issubclass(int8, cortopy.object)
示例#9
0
def test_declare_child_int8_type(name):
    int8 = cortopy.gettype("int8")
    cortopy.declare_child(None, name, int8)