Exemplo n.º 1
0
def test_skipauto():
    plug = df.XDressPlugin()
    plugins = DEFAULT_PLUGINS + plug.requires + ('xdress.descfilter', )
    rc = RunControl(rc=DEFAULT_RC_FILE, plugins=plugins)
    rc._update(plug.defaultrc)
    rc.skipauto = True
    rc.ts = TypeSystem()
    rc.env = {'plane.cpp': {'Plane': plane_class}}

    plug.setup(rc)
    plug.execute(rc)
    plug.teardown(rc)

    exp_plane = {
        'name': 'Plane',
        'namespace': 'util',
        'parents': [],
        'attrs': {
            'homeAirport': 'str',
            'maxrpm': 'float64',
            'manufacturer': 'str',
            'maxspeed': 'float32',
            'position': ('vector', 'float64')
        },
        'methods': {
            ('Plane', ): None,
            ('Plane', ('homeAirport', 'str')): None,
            ('~Plane', ): None,
            ('land', ('coord', (('vector', 'int32', 'const'), '&'))): {
                'return': 'str'
            },
            ('isOnFire', ): {
                'return': 'bool'
            }
        }
    }

    plane = rc.env['plane.cpp']['Plane']
    print('********\nplane class stuff (actual then expected):\n')
    pprint.pprint(plane)
    pprint.pprint(exp_plane)
    assert_equal(plane, exp_plane)
Exemplo n.º 2
0
def test_skipauto():
    plug = df.XDressPlugin()
    plugins = DEFAULT_PLUGINS + plug.requires + ("xdress.descfilter",)
    rc = RunControl(rc=DEFAULT_RC_FILE, plugins=plugins)
    rc._update(plug.defaultrc)
    rc.skipauto = True
    rc.ts = TypeSystem()
    rc.env = {"plane.cpp": {"Plane": plane_class}}

    plug.setup(rc)
    plug.execute(rc)
    plug.teardown(rc)

    exp_plane = {
        "name": "Plane",
        "namespace": "util",
        "parents": [],
        "attrs": {
            "homeAirport": "str",
            "maxrpm": "float64",
            "manufacturer": "str",
            "maxspeed": "float32",
            "position": ("vector", "float64"),
        },
        "methods": {
            ("Plane",): None,
            ("Plane", ("homeAirport", "str")): None,
            ("~Plane",): None,
            ("land", ("coord", (("vector", "int32", "const"), "&"))): {"return": "str"},
            ("isOnFire",): {"return": "bool"},
        },
    }

    plane = rc.env["plane.cpp"]["Plane"]
    print("********\nplane class stuff (actual then expected):\n")
    pprint.pprint(plane)
    pprint.pprint(exp_plane)
    assert_equal(plane, exp_plane)
Exemplo n.º 3
0
def test_skipauto():
    plug = df.XDressPlugin()
    plugins = DEFAULT_PLUGINS + plug.requires + ('xdress.descfilter',)
    rc = RunControl(rc=DEFAULT_RC_FILE, plugins=plugins)
    rc._update(plug.defaultrc)
    rc.skipauto = True
    rc.ts = TypeSystem()
    rc.env = {'plane.cpp': {'Plane': plane_class}}

    plug.setup(rc)
    plug.execute(rc)
    plug.teardown(rc)

    exp_plane = {
        'name': 'Plane',
        'namespace': 'util',
        'parents': [],
        'attrs': {
            'homeAirport': 'str',
            'maxrpm': 'float64',
            'manufacturer': 'str',
            'maxspeed': 'float32',
            'position': ('vector', 'float64')},
        'methods': {
            ('Plane',): None,
            ('Plane', ('homeAirport', 'str')): None,
            ('~Plane',): None,
            ('land', ('coord', (('vector', 'int32', 'const'), '&'))): {
                'return': 'str'},
            ('isOnFire',): {
                'return': 'bool'}}
    }

    plane = rc.env['plane.cpp']['Plane']
    print('********\nplane class stuff (actual then expected):\n')
    pprint.pprint(plane)
    pprint.pprint(exp_plane)
    assert_equal(plane, exp_plane)
Exemplo n.º 4
0
def test_rc_update():
    rc = RunControl(a=NotSpecified, b="hello")
    rc._update(RunControl(c=1, b="world"))
    assert_equal(rc, {'a': NotSpecified, 'b': 'world', 'c': 1})
    rc._update({'a': 42, 'c': NotSpecified})
    assert_equal(rc, {'a': 42, 'b': 'world', 'c': 1})
Exemplo n.º 5
0
def test_rc_update():
    rc = RunControl(a=NotSpecified, b="hello")
    rc._update(RunControl(c=1, b="world"))
    assert_equal(rc, {'a': NotSpecified, 'b': 'world', 'c': 1})
    rc._update({'a': 42, 'c': NotSpecified})
    assert_equal(rc, {'a': 42, 'b': 'world', 'c': 1})
Exemplo n.º 6
0
def test_rc_update():
    rc = RunControl(a=NotSpecified, b="hello")
    rc._update(RunControl(c=1, b="world"))
    assert_equal(rc, {"a": NotSpecified, "b": "world", "c": 1})
    rc._update({"a": 42, "c": NotSpecified})
    assert_equal(rc, {"a": 42, "b": "world", "c": 1})