Exemplo n.º 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
Exemplo n.º 2
0
def test_deserialize_point_once():
    cortopy.eval(
"""
struct PointA::
    x, y: int64
"""
    )
    Point = cortopy.gettype("PointA")
Exemplo n.º 3
0
def Line4d(Point3d):
    cortopy.eval(
"""
struct Line4d::
    a, b: Point4d
"""
    )
    t = cortopy.gettype("Line4d")
    return t
Exemplo n.º 4
0
def Point4d(Point3d):
    cortopy.eval(
"""
struct Point4d: Point3d::
    w: int64
"""
    )
    t = cortopy.gettype("Point4d")
    return t
Exemplo n.º 5
0
def Point3d():
    cortopy.eval(
"""
struct Point3d::
    x, y, z: int64
"""
    )
    t = cortopy.gettype("Point3d")
    return t
Exemplo n.º 6
0
def test_serializeType():
    a = cortopy.gettype("bool")
Exemplo n.º 7
0
def test_int8_mro(name):
    int8 = cortopy.gettype("int8")
    assert int8.__mro__ == (cortopy.types["int8"], cortopy.object, object)
Exemplo n.º 8
0
def test_int8_type_and_superclass(name):
    int8 = cortopy.gettype("int8")
    assert isinstance(int8, type)
    assert issubclass(int8, cortopy.object)
Exemplo n.º 9
0
def test_declare_child_int8_type(name):
    int8 = cortopy.gettype("int8")
    cortopy.declare_child(None, name, int8)