# Path: peru/async_helpers.py
# def run_task(coro):
#     return EVENT_LOOP.run_until_complete(coro)


from peru.async_helpers import run_task
import peru.scope
import shared


class ScopeTest(shared.PeruTest):
    def test_parse_target(self):
        scope = scope_tree_to_scope({
            'modules': {
                'a': {
                    'modules': {
                        'b': {
                            'modules': {
                                'c': {}
                            },
                            'rules': ['r'],
                        }
                    }
                }
            }
        })

# Path: peru/async_helpers.py
# def run_task(coro):
#     return EVENT_LOOP.run_until_complete(coro)


# Path: tests/test_scope.py
from peru.async_helpers import run_task
import peru.scope
import shared



class ScopeTest(shared.PeruTest):
    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'))