Example #1
0
def test_genpxd():
    ts.register_class('FCComp', 
                      cython_c_type='cpp_fccomp.FCComp', 
                      cython_cimport='cpp_fccomp', 
                      cython_cy_type='fccomp.FCComp', 
                      cython_cyimport='fccomp')
    obs = cg.genpxd(toaster_desc).splitlines()
    ts.deregister_class('FCComp')
    exp = exp_pxd.splitlines()
    assert_equal(len(obs), len(exp))
    for o, e in zip(obs, exp):
        assert_equal(o, e)
Example #2
0
def test_gencpppxd():
    ts.register_class('FCComp', 
                      cython_c_type='cpp_fccomp.FCComp', 
                      cython_cimport='cpp_fccomp', 
                      cython_cy_type='fccomp.FCComp', 
                      cython_cyimport='fccomp')
    ts.register_class('Toaster', 
                      cython_c_type='cpp_toaster.Toaster', 
                      cython_cimport='cpp_toaster', 
                      cython_cy_type='toaster.Toaster', 
                      cython_cyimport='toaster', 
                      cython_py_type='Toaster.Toaster',
                      )
    obs = cg.gencpppxd(toaster_desc).splitlines()
    exp = exp_cpppxd.splitlines()
    ts.deregister_class('FCComp')
    ts.deregister_class('Toaster')
    print "\n".join(obs)
    assert_equal(len(obs), len(exp))
    for o, e in zip(obs, exp):
        assert_equal(o, e)
Example #3
0
def test_genpyx():
    ts.register_class('FCComp', 
                      cython_c_type='cpp_fccomp.FCComp', 
                      cython_cimport='cpp_fccomp', 
                      cython_cy_type='fccomp.FCComp', 
                      cython_cyimport='fccomp', 
                      cython_py_type='fccomp.FCComp',
                      )
    ts.register_class('Toaster', 
                      cython_c_type='cpp_toaster.Toaster', 
                      cython_cimport='cpp_toaster', 
                      cython_cy_type='toaster.Toaster', 
                      cython_cyimport='toaster', 
                      cython_py_type='Toaster.Toaster',
                      )
    obs = cg.genpyx(toaster_desc, {'Toaster': toaster_desc, 
        'FCComp': {'name': 'FCComp', 'parents': []}}).splitlines()
    ts.deregister_class('FCComp')
    ts.deregister_class('Toaster')
    print "\n".join(obs)
    exp = exp_pyx.splitlines()
    assert_equal(len(obs), len(exp))
    for o, e in zip(obs, exp):
        assert_equal(o, e)