コード例 #1
0
ファイル: test_descfilter.py プロジェクト: ronaldnie/xdress
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)
コード例 #2
0
ファイル: test_descfilter.py プロジェクト: jkhoogland/xdress
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)
コード例 #3
0
ファイル: test_descfilter.py プロジェクト: crbates/xdress
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)
コード例 #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})
コード例 #5
0
ファイル: test_utils.py プロジェクト: AlexandreCampo/xdress
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})
コード例 #6
0
ファイル: test_utils.py プロジェクト: jkhoogland/xdress
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})