An assert in ipalib/frontend.py (line 1259) makes ipatests/test_ipalib/test_frontend.py::test_Object::test_init fail with assertion error:
E assert <class 'ipalib.base.NameSpace'> is APINameSpace E + where <class 'ipalib.base.NameSpace'> = type(NameSpace(<30 members>, sort=True))
Traceback:
self = <ipatests.test_ipalib.test_frontend.test_Object object at 0x7f29db1e8350> def test_init(self): """ Test the `ipalib.frontend.Object.__init__` method. """ # Setup for test: class DummyAttribute(object): def __init__(self, obj_name, attr_name, name=None): self.obj_name = obj_name self.attr_name = attr_name if name is None: self.name = '%s_%s' % (obj_name, attr_name) else: self.name = name self.param = frontend.create_param(attr_name) def __clone__(self, attr_name): return self.__class__( self.obj_name, self.attr_name, getattr(self, attr_name) ) def get_attributes(cnt, format): for name in ['other', 'user', 'another']: for i in range(cnt): yield DummyAttribute(name, format % i) cnt = 10 methods_format = 'method_%d' class FakeAPI(object): Method = NameSpace( get_attributes(cnt, methods_format) ) def __contains__(self, key): return hasattr(self, key) def __getitem__(self, key): return getattr(self, key) def is_production_mode(self): return False api = FakeAPI() assert len(api.Method) == cnt * 3 class user(self.cls): pass # Actually perform test: o = user(api) assert read_only(o, 'api') is api > namespace = o.methods ipatests/test_ipalib/test_frontend.py:967: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ ipalib/plugable.py:243: in __get__ obj.ensure_finalized() ipalib/plugable.py:218: in ensure_finalized self.finalize() ipalib/plugable.py:198: in finalize self._on_finalize() ipalib/frontend.py:1212: in _on_finalize self.__get_attrs('Method'), sort=False, name_attr='attr_name' ipalib/base.py:411: in __init__ self.__members = tuple(members) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = ipatests.test_ipalib.test_frontend.user(), name = 'Method' def __get_attrs(self, name): if name not in self.api: return namespace = self.api[name] > assert type(namespace) is APINameSpace E assert <class 'ipalib.base.NameSpace'> is APINameSpace E + where <class 'ipalib.base.NameSpace'> = type(NameSpace(<30 members>, sort=True)) ipalib/frontend.py:1259: AssertionError
4.4.0 was released, moving open tickets to 4.4.1
Closing as duplicate of already fixed and closed https://fedorahosted.org/freeipa/ticket/6188.
Metadata Update from @lryznaro: - Issue assigned to someone - Issue set to the milestone: FreeIPA 4.4.1
Login to comment on this ticket.