[tahoe-lafs-trac-stream] [Tahoe-LAFS] #1634: TypeError due to "size" being None in pyfilesystem+dokan
Tahoe-LAFS
trac at tahoe-lafs.org
Fri Oct 10 02:52:30 UTC 2014
#1634: TypeError due to "size" being None in pyfilesystem+dokan
-------------------------+-------------------------------------------------
Reporter: zooko | Owner: Zancas
Type: defect | Status: new
Priority: major | Milestone: 1.11.0
Component: code- | Version: 1.9.0
frontend-web | Keywords: pyfilesystem dokan error webapi
Resolution: | docs mutable test-needed
Launchpad Bug: |
-------------------------+-------------------------------------------------
Comment (by Zancas):
OK, I've submitted a pull request, here:
https://github.com/tahoe-lafs/tahoe-lafs/pull/119
There's a significant enhancement which might be worth doing. We could
make mock objects with "spec_set=RealObject()" arguments.
For example:
{{{
import mock
from allmydata.immutable.filenode import ImmutableFileNode
XXX
immutable_filenode_template_object = ImmutableFileNode(foo, blah, spam,
...)
mock_immutable_filenode =
mock.Mock(spec_set=immutable_filenode_template_object)
}}}
Then do the same for the other filenode types we're mocking. The reason I
didn't do this already is because in the "XXX" above I'd need to make mock
"foo", "blah", and "spam" objects. I think this is worth it _except_ mock
filenodes of the appropriate type have almost certainly already been
constructed (in test_web.py), so I thought I'd mention this potential work
here before reinventing the wheel!
Also, https://github.com/rrymer contributed significantly to this code.
--
Ticket URL: <https://tahoe-lafs.org/trac/tahoe-lafs/ticket/1634#comment:25>
Tahoe-LAFS <https://Tahoe-LAFS.org>
secure decentralized storage
More information about the tahoe-lafs-trac-stream
mailing list