> 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::
> 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 Archetypes. WebDAVSupport?
> import the definition from Products.
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::
------- ------- ------- ------ %< ------- ------- ------- ----- //svn.zope. org/repos/ main/Products. GenericSetup/ trunk gs 2.6.5/bin/ python bootstrap.py && bin/buildout ------- ------- ------ %< ------- ------- ------- -----
$ cd /tmp
$ svn co svn+ssh:
$ cd gs
$ /opt/Python-
...
$ bin/test --all
...
Total: 396 tests, 0 failures, 0 errors in 1.986 seconds.
-------
What branch are you starting from?