# Path: pyecore/utils.py
# def dispatch(func):
#     dispatcher = singledispatch(func)
# 
#     def wrapper(*args, **kw):
#         return dispatcher.dispatch(args[1].__class__)(*args, **kw)
# 
#     def register(cls, func=None):
#         if isinstance(cls, EObject):
#             return dispatcher.register(cls.python_class)
#         return dispatcher.register(cls)
#     wrapper.register = register
#     update_wrapper(wrapper, func)
#     return wrapper


import pytest
from pyecore.ecore import *
from pyecore.utils import dispatch


def test_dispatch_dynamic_mm():
    A = EClass('A')
    B = EClass('B')

    class SequenceSwitch(object):
        def __init__(self):
            self.sequence = []


# Path: pyecore/utils.py
# def dispatch(func):
#     dispatcher = singledispatch(func)
# 
#     def wrapper(*args, **kw):
#         return dispatcher.dispatch(args[1].__class__)(*args, **kw)
# 
#     def register(cls, func=None):
#         if isinstance(cls, EObject):
#             return dispatcher.register(cls.python_class)
#         return dispatcher.register(cls)
#     wrapper.register = register
#     update_wrapper(wrapper, func)
#     return wrapper


# Path: tests/test_dispatch.py
import pytest
from pyecore.ecore import *
from pyecore.utils import dispatch



def test_dispatch_dynamic_mm():
    A = EClass('A')
    B = EClass('B')

    class SequenceSwitch(object):
        def __init__(self):
            self.sequence = []


        @dispatch