Comment 6 for bug 722726

Revision history for this message
Tres Seaver (tseaver) wrote :

> In the specific case of Plone and ATFile, a PdataStreamIterator object
> is passed in rather than a file.

Ah, I thought ATFile was already using blobs.

> Do I mock this in the test? Is it ok to
> import the definition from Products.Archetypes.WebDAVSupport?

We should mock it: GenericSetup can't depend on Archetypes. Something
simple should do the trick: we just need an iterable which yields chunks
of text, so we could use a list::

  ['chunk1', 'chunk2']

We could maybe sniff for attributes 'file', 'size', and 'streamsize',
and special case them (since the 'file' attribute of PdataStreamIterator
is already a tempfile). The mock would be really simple::

  class DummyIterator(object):
      streamsize = 13
      def __init__(self, text):
          self.file = StringIO(text)
          self.size = len(text)

> Some tests are already broken. May be yuppie's most recent commit.

Hmm, they are passing for me::

--------------------------- %< --------------------------
$ cd /tmp
$ svn co svn+ssh://svn.zope.org/repos/main/Products.GenericSetup/trunk gs
$ cd gs
$ /opt/Python-2.6.5/bin/python bootstrap.py && bin/buildout
...
$ bin/test --all
...
Total: 396 tests, 0 failures, 0 errors in 1.986 seconds.
--------------------------- %< --------------------------

What branch are you starting from?