Ejemplo n.º 1
0
 def test_parse_target(self):
     scope = scope_tree_to_scope({
         'modules': {
             'a': {
                 'modules': {
                     'b': {
                         'modules': {'c': {}},
                         'rules': ['r'],
                     }
                 }
             }
         }
     })
     c, (r,) = run_task(scope.parse_target(DummyRuntime(), 'a.b.c|a.b.r'))
     assert type(c) is DummyModule and c.name == 'a.b.c'
     assert type(r) is DummyRule and r.name == 'a.b.r'
Ejemplo n.º 2
0
 def test_parse_target(self):
     scope = scope_tree_to_scope({
         'modules': {
             'a': {
                 'modules': {
                     'b': {
                         'modules': {
                             'c': {}
                         },
                         'rules': ['r'],
                     }
                 }
             }
         }
     })
     c, (r, ) = run_task(scope.parse_target(DummyRuntime(), 'a.b.c|a.b.r'))
     assert type(c) is DummyModule and c.name == 'a.b.c'
     assert type(r) is DummyRule and r.name == 'a.b.r'
Ejemplo n.º 3
0
def test_plugin_get_reup_fields(context, type, fields):
    handle = TestDisplayHandle()
    return run_task(plugin.plugin_get_reup_fields(
        context, type, fields, handle))
Ejemplo n.º 4
0
def test_plugin_fetch(context, type, fields, dest):
    handle = TestDisplayHandle()
    run_task(plugin.plugin_fetch(context, type, fields, dest, handle))
    return handle.getvalue()
Ejemplo n.º 5
0
 def wrapper(*args, **kwargs):
     return run_task(f(*args, **kwargs))
Ejemplo n.º 6
0
 def wrapper(*args, **kwargs):
     return run_task(asyncio.coroutine(f)(*args, **kwargs))
Ejemplo n.º 7
0
def test_plugin_get_reup_fields(context, type, fields):
    handle = TestDisplayHandle()
    return run_task(
        plugin.plugin_get_reup_fields(context, type, fields, handle))
Ejemplo n.º 8
0
def test_plugin_fetch(context, type, fields, dest):
    handle = TestDisplayHandle()
    run_task(plugin.plugin_fetch(context, type, fields, dest, handle))
    return handle.getvalue()
Ejemplo n.º 9
0
 def wrapper(*args, **kwargs):
     return run_task(f(*args, **kwargs))
Ejemplo n.º 10
0
 def wrapper(*args, **kwargs):
     return run_task(asyncio.coroutine(f)(*args, **kwargs))