[Dev] TestCollections unit tests fail
John Anderson
john at osafoundation.org
Mon Aug 8 08:20:07 PDT 2005
Hi Ted:
I found the problem. It looks like EmailAddress got moved. I fixed that,
but I'm now running into another problem because inviteeOf is an
ItemCollection and it now needs to be an AbstractCollection. Changing
this will break Chandler, so we should probably branch before making the
change.
John
John Anderson wrote:
> Hi Ted:
>
> I checked in Collections.py and TestCollections.py along with your
> changes to Item.kind
> <imap://john@osafoundation.org:993/fetch%3EUID%3E.INBOX%3E28253#trunkchandlerrepositorypacksschemamodelItemkind>
> and noticed that your unit tests fail. On first glance it wasn't
> obvious why the test was failing since there were no references to
> Mail from Collections.py or ContentModel.py (see below). I commented
> out the bottom few lines of TestCollections.py so I could check it in.
> Could you track down and fix the bug then comment the test back in.
>
> Thanks,
> John
>
> [ TestCollections.py ]: Testing
> /cygdrive/d/John/osaf/chandler/parcels/osaf/contentmodel/tests/TestCollections.py
> Executing: 'd:\\John\\osaf/chandler/release/bin/python.exe'
> 'python.exe' 'TestCollections.py' '-v'
> Current directory:
> /cygdrive/d/John/osaf/chandler/parcels/osaf/contentmodel/tests
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - start -
> testDelayedCreation (__main__.CollectionTests) ... ERROR
> testDifference (__main__.CollectionTests) ... ERROR
> testFilteredCollection (__main__.CollectionTests) ... ERROR
> testFilters (__main__.CollectionTests) ... ERROR
> testIndices (__main__.CollectionTests) ... ERROR
> testItemCollection (__main__.CollectionTests) ... ERROR
> testKindCollection (__main__.CollectionTests) ... ERROR
> testUnion (__main__.CollectionTests) ... ERROR
>
> ======================================================================
> ERROR: testDelayedCreation (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testDifference (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testFilteredCollection (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testFilters (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testIndices (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testItemCollection (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testKindCollection (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ======================================================================
> ERROR: testUnion (__main__.CollectionTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "TestCollections.py", line 33, in setUp
> self.b1 = ListCollection('b1', view=self.view)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 213, in __init__
> super(ListCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\Collections.py", line
> 98, in __init__
> super(AbstractCollection, self).__init__(*args, **kw)
> File
> "d:\John\osaf\chandler\parcels\osaf\contentmodel\ContentModel.py",
> line 164, in __init__
> super(ContentItem, self).__init__(name, parent, kind, view, **kw)
> File "d:\John\osaf\chandler\application\schema.py", line 554, in
> __init__
> kind = self.getKind(view)
> File "d:\John\osaf\chandler\application\schema.py", line 567, in getKind
> return itemFor(cls,view)
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 451, in
> _init_schema_item
> kind.superKinds = [
> File "d:\John\osaf\chandler\application\schema.py", line 1119, in
> itemFor
> obj._init_schema_item(item,view)
> File "d:\John\osaf\chandler\application\schema.py", line 464, in
> _init_schema_item
> ai = itemFor(attr, view)
> File "d:\John\osaf\chandler\application\schema.py", line 1108, in
> itemFor
> item = view._schema_cache[obj] = obj._create_schema_item(view)
> File "d:\John\osaf\chandler\application\schema.py", line 265, in
> _create_schema_item
> self.inverse = self.inverse.referent() # force resolution now
> File "d:\John\osaf\chandler\application\schema.py", line 57, in referent
> type = type.referent()
> File "d:\John\osaf\chandler\application\schema.py", line 48, in referent
> return importString(self.name, module.__dict__)
> File "d:\John\osaf\chandler\application\schema.py", line 815, in
> importString
> item = __import__('.'.join(path), globalDict, globalDict,
> ['__name__'])
> ImportError: No module named Mail
>
> ----------------------------------------------------------------------
> Ran 8 tests in 15.375s
>
> FAILED (errors=8)
> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
> - end - -
> close failed: [Errno 9] Bad file descriptor
> [ TestCollections.py ] ***ERROR*** : Exit code = 1
> [ Tests ] ***ERROR*** : Failed:
> /cygdrive/d/John/osaf/chandler/parcels/osaf/contentmodel/tests/TestCollections.py
>
>------------------------------------------------------------------------
>
>_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
>
>Open Source Applications Foundation "Dev" mailing list
>http://lists.osafoundation.org/mailman/listinfo/dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osafoundation.org/pipermail/dev/attachments/20050808/a208bb4b/attachment.htm
More information about the Dev
mailing list