# 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
def lib():
    NamedElement = EClass('NamedElement', abstract=True)
    NamedElement.eStructuralFeatures.append(EAttribute('name', EString))
    NamedElement.eStructuralFeatures.append(EAttribute('level', EInteger))
    Root = EClass('Root')
    Root.eStructuralFeatures.append(EReference('namedElements', eType=NamedElement, containment=True, upper=-1, unique=False))
    Root.eStructuralFeatures.append(EReference('ne_oset', eType=NamedElement, containment=True, upper=-1))
    Root.eStructuralFeatures.append(EReference('ne_set', eType=NamedElement, containment=True, upper=-1, ordered=False))

    A = EClass('A', superclass=NamedElement)
    B = EClass('B', superclass=NamedElement)
    inner_ref = EReference('inner', eType=NamedElement, containment=True, upper=-1)
    B.eStructuralFeatures.append(inner_ref)
    NamedElement.eStructuralFeatures.append(EReference('parent', eType=B, eOpposite=inner_ref))

    sibiling_ref = EReference('sibiling', eType=B)
    A.eStructuralFeatures.append(sibiling_ref)
    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()

# 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

def lib():
    NamedElement = EClass('NamedElement', abstract=True)
    NamedElement.eStructuralFeatures.append(EAttribute('name', EString))
    NamedElement.eStructuralFeatures.append(EAttribute('level', EInteger))
    Root = EClass('Root')
    Root.eStructuralFeatures.append(EReference('namedElements', eType=NamedElement, containment=True, upper=-1, unique=False))
    Root.eStructuralFeatures.append(EReference('ne_oset', eType=NamedElement, containment=True, upper=-1))
    Root.eStructuralFeatures.append(EReference('ne_set', eType=NamedElement, containment=True, upper=-1, ordered=False))

    A = EClass('A', superclass=NamedElement)
    B = EClass('B', superclass=NamedElement)
    inner_ref = EReference('inner', eType=NamedElement, containment=True, upper=-1)
    B.eStructuralFeatures.append(inner_ref)
    NamedElement.eStructuralFeatures.append(EReference('parent', eType=B, eOpposite=inner_ref))

    sibiling_ref = EReference('sibiling', eType=B)
    A.eStructuralFeatures.append(sibiling_ref)
    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()