zope.app.container.btree.BTreeContainer is not inheriting from ZODB BTrees directly. In order to access the real btree data container, we have to go through the data container attribute (_SampleContainer__data). The BTree data container is a pure C object, it doesn't provide/implement anything, therefore it's impossible to test it against an interface.
I have a code working, with tests, for the "clear" method. The problem is : we would rely purely on the zope.container implementation and it's not good. Even more, zope.container.btree doesn't provide an object implementing a Btrees.Interfaces interface. Maybe we should make zope.container at least implementing Btrees.Interfaces.ICollection ? If not, we could, in Grok, provide a clean implementation that does really provide what we are expecting : a real BTrees.IBTree.
zope.app. container. btree.BTreeCont ainer is not inheriting from ZODB BTrees directly. In order to access the real btree data container, we have to go through the data container attribute (_SampleContain er__data) . The BTree data container is a pure C object, it doesn't provide/implement anything, therefore it's impossible to test it against an interface.
I have a code working, with tests, for the "clear" method. The problem is : we would rely purely on the zope.container implementation and it's not good. Even more, zope.container. btree doesn't provide an object implementing a Btrees.Interfaces interface. Maybe we should make zope.container at least implementing Btrees. Interfaces. ICollection ? If not, we could, in Grok, provide a clean implementation that does really provide what we are expecting : a real BTrees.IBTree.