# Path: pyecore/resources/resource.py
# class ResourceSet(object):
# class URI(object):
# class HttpURI(URI):
# class MetamodelDecoder(object):
# class Global_URI_decoder(object):
# class URIMapper(object):
# class URIConverter(object):
# class AbstractURIConverter(object):
# class HttpURIConverter(AbstractURIConverter):
# class LocalMetamodelDecoder(object):
# class Resource(object):
#     def __init__(self):
#     def create_resource(self, uri):
#     def remove_resource(self, resource):
#     def get_resource(self, uri, options=None):
#     def can_resolve(self, uri_path, from_resource=None):
#     def resolve(self, uri, from_resource=None):
#     def __init__(self, uri):
#     def _split(self):
#     def protocol(self):
#     def extension(self):
#     def segments(self):
#     def last_segment(self):
#     def create_instream(self):
#     def close_stream(self):
#     def create_outstream(self):
#     def normalize(self):
#     def relative_from_me(self, other_uri):
#     def apply_relative_from_me(self, relative_path):
#     def __init__(self, uri):
#     def create_instream(self):
#     def create_outstream(self):
#     def apply_relative_from_me(self, relative_path):
#     def split_path(path):
#     def can_resolve(path, registry):
#     def resolve(path, registry):
#     def can_resolve(path, from_resource=None):
#     def resolve(path, from_resource=None):
#     def translate(path, from_resource=None):
#     def convert(cls, uri, resource_set=None):
#     def can_handle(uri):
#     def convert(uri):
#     def can_handle(uri):
#     def convert(uri):
#     def can_resolve(path, from_resource=None):
#     def resolve(path, from_resource=None):
#     def __init__(self, uri=None, use_uuid=False):
#     def uri(self):
#     def uri(self, value):
#     def resolve(self, fragment, resource=None):
#     def resolve_object(self, path):
#     def extract_rootnum_and_frag(fragment):
#     def prefix2epackage(self, prefix):
#     def get_metamodel(self, nsuri):
#     def normalize(fragment):
#     def _is_external(self, path):
#     def _get_href_decoder(self, path, original_path):
#     def _try_resource_autoload(self, uri, original_uri):
#     def is_fragment_uuid(fragment):
#     def _navigate_from(cls, path, start_obj):
#     def get_id_attribute(eclass):
#     def _build_path_from(self, obj):
#     def _assign_uuid(obj):
#     def append(self, root):
#     def remove(self, root):
#     def open_out_stream(self, other=None):
#     def extend(self, values):
#     def _find_feature(self, eclass, name):


import pytest
import pyecore.ecore as Ecore
from pyecore.ecore import *
from pyecore.resources import global_registry, ResourceSet
from os import path

    b.delete()
    assert a.simpleb is None


def test_delete_simpledelete_simple_opposite(model1, lib):
    a = model1.a[0]
    b = lib.getEClassifier('B')()
    a.invb = b
    assert a.invb is b
    assert a in b.froma

    b.delete()
    assert a.simpleb is None
    assert len(b.froma) == 0


def test_delete_simpledelete_multi_opposite(model1, lib):
    a = model1.a[0]
    b = lib.getEClassifier('B')()
    a.multib.append(b)
    assert b in a.multib
    assert b.sa is a

    b.delete()
    assert len(a.multib) == 0
    assert b.sa is None


def test_delete_unresolved_proxy(lib):

# Path: pyecore/resources/resource.py
# class ResourceSet(object):
# class URI(object):
# class HttpURI(URI):
# class MetamodelDecoder(object):
# class Global_URI_decoder(object):
# class URIMapper(object):
# class URIConverter(object):
# class AbstractURIConverter(object):
# class HttpURIConverter(AbstractURIConverter):
# class LocalMetamodelDecoder(object):
# class Resource(object):
#     def __init__(self):
#     def create_resource(self, uri):
#     def remove_resource(self, resource):
#     def get_resource(self, uri, options=None):
#     def can_resolve(self, uri_path, from_resource=None):
#     def resolve(self, uri, from_resource=None):
#     def __init__(self, uri):
#     def _split(self):
#     def protocol(self):
#     def extension(self):
#     def segments(self):
#     def last_segment(self):
#     def create_instream(self):
#     def close_stream(self):
#     def create_outstream(self):
#     def normalize(self):
#     def relative_from_me(self, other_uri):
#     def apply_relative_from_me(self, relative_path):
#     def __init__(self, uri):
#     def create_instream(self):
#     def create_outstream(self):
#     def apply_relative_from_me(self, relative_path):
#     def split_path(path):
#     def can_resolve(path, registry):
#     def resolve(path, registry):
#     def can_resolve(path, from_resource=None):
#     def resolve(path, from_resource=None):
#     def translate(path, from_resource=None):
#     def convert(cls, uri, resource_set=None):
#     def can_handle(uri):
#     def convert(uri):
#     def can_handle(uri):
#     def convert(uri):
#     def can_resolve(path, from_resource=None):
#     def resolve(path, from_resource=None):
#     def __init__(self, uri=None, use_uuid=False):
#     def uri(self):
#     def uri(self, value):
#     def resolve(self, fragment, resource=None):
#     def resolve_object(self, path):
#     def extract_rootnum_and_frag(fragment):
#     def prefix2epackage(self, prefix):
#     def get_metamodel(self, nsuri):
#     def normalize(fragment):
#     def _is_external(self, path):
#     def _get_href_decoder(self, path, original_path):
#     def _try_resource_autoload(self, uri, original_uri):
#     def is_fragment_uuid(fragment):
#     def _navigate_from(cls, path, start_obj):
#     def get_id_attribute(eclass):
#     def _build_path_from(self, obj):
#     def _assign_uuid(obj):
#     def append(self, root):
#     def remove(self, root):
#     def open_out_stream(self, other=None):
#     def extend(self, values):
#     def _find_feature(self, eclass, name):


# Path: tests/xmi/test_delete.py
import pytest
import pyecore.ecore as Ecore
from pyecore.ecore import *
from pyecore.resources import global_registry, ResourceSet
from os import path


    b.delete()
    assert a.simpleb is None


def test_delete_simpledelete_simple_opposite(model1, lib):
    a = model1.a[0]
    b = lib.getEClassifier('B')()
    a.invb = b
    assert a.invb is b
    assert a in b.froma

    b.delete()
    assert a.simpleb is None
    assert len(b.froma) == 0


def test_delete_simpledelete_multi_opposite(model1, lib):
    a = model1.a[0]
    b = lib.getEClassifier('B')()
    a.multib.append(b)
    assert b in a.multib
    assert b.sa is a

    b.delete()
    assert len(a.multib) == 0
    assert b.sa is None


def test_delete_unresolved_proxy(lib):

    rset = ResourceSet()