Пример #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'
Пример #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'
Пример #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))
Пример #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()
Пример #5
0
 def wrapper(*args, **kwargs):
     return run_task(f(*args, **kwargs))
Пример #6
0
 def wrapper(*args, **kwargs):
     return run_task(asyncio.coroutine(f)(*args, **kwargs))
Пример #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))
Пример #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()
Пример #9
0
 def wrapper(*args, **kwargs):
     return run_task(f(*args, **kwargs))
Пример #10
0
 def wrapper(*args, **kwargs):
     return run_task(asyncio.coroutine(f)(*args, **kwargs))