# Path: pyecore/notification.py
# class EObserver(object):
#     def __init__(self, notifier=None, notifyChanged=None):
#         if notifier:
#             notifier.listeners.append(self)
#         if notifyChanged:
#             self.notifyChanged = notifyChanged
# 
#     def observe(self, notifier):
#         notifier.listeners.append(self)
# 
#     def notifyChanged(self, notification):
#         pass
# 
# class Kind(Enum):
#     ADD = 0
#     ADD_MANY = 1
#     MOVE = 2
#     REMOVE = 3
#     REMOVE_MANY = 4
#     SET = 5
#     UNSET = 6


import pytest
from pyecore.ecore import *
from pyecore.notification import EObserver, Kind
    B.eStructuralFeatures.append(EReference('sibiling', eType=A, eOpposite=sibiling_ref))
    lib = EPackage('lib')
    lib.eClassifiers.extend([Root, NamedElement, A, B])
    lib.Root = Root
    lib.NamedElement = NamedElement
    lib.A = A
    lib.B = B
    return lib


def test_notification_dummy(lib):
    root = lib.Root()
    a1 = lib.A()
    observer = EObserver()
    observer.observe(root)
    root.namedElements.append(a1)


def test_notification_print(lib):
    root = lib.Root()
    a1 = lib.A()
    observer = EObserver()
    observer.observe(root)
    observer.notify = lambda x: print(x)
    root.namedElements.append(a1)


def test_notification_add(lib):
    root = lib.Root()
    a1 = lib.A()

# Path: pyecore/notification.py
# class EObserver(object):
#     def __init__(self, notifier=None, notifyChanged=None):
#         if notifier:
#             notifier.listeners.append(self)
#         if notifyChanged:
#             self.notifyChanged = notifyChanged
# 
#     def observe(self, notifier):
#         notifier.listeners.append(self)
# 
#     def notifyChanged(self, notification):
#         pass
# 
# class Kind(Enum):
#     ADD = 0
#     ADD_MANY = 1
#     MOVE = 2
#     REMOVE = 3
#     REMOVE_MANY = 4
#     SET = 5
#     UNSET = 6


# Path: tests/test_dynamic_notifications.py
import pytest
from pyecore.ecore import *
from pyecore.notification import EObserver, Kind

    B.eStructuralFeatures.append(EReference('sibiling', eType=A, eOpposite=sibiling_ref))
    lib = EPackage('lib')
    lib.eClassifiers.extend([Root, NamedElement, A, B])
    lib.Root = Root
    lib.NamedElement = NamedElement
    lib.A = A
    lib.B = B
    return lib


def test_notification_dummy(lib):
    root = lib.Root()
    a1 = lib.A()
    observer = EObserver()
    observer.observe(root)
    root.namedElements.append(a1)


def test_notification_print(lib):
    root = lib.Root()
    a1 = lib.A()
    observer = EObserver()
    observer.observe(root)
    observer.notify = lambda x: print(x)
    root.namedElements.append(a1)


def test_notification_add(lib):
    root = lib.Root()
    a1 = lib.A()

    notifyChanged = lambda x: assert_wrap(x.kind is Kind.ADD