예제 #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)