conestack / node

Other
24 stars 24 forks source link

Broken implementation of mapping interface? #3

Closed attilaolah closed 2 years ago

attilaolah commented 13 years ago

When I base my class on a FactoryNode and try to verify the implementation, I get this error message: BrokenMethodImplementation: The implementation of pop violates its contract because implementation doesn't support variable arguments.

Any idea why is this?

rnixx commented 13 years ago

how do you verify the impl?

attilaolah commented 13 years ago

zope.interface.verify.verifyClass(IFoo, Foo) and zope.interface.verify.verifyObject(IFoo, Foo())

attilaolah commented 13 years ago

I like to put these in unit tests.

rnixx commented 13 years ago

ok, sounds good.

attilaolah commented 13 years ago

What I do in subclasses is that I provide the missing implementation so that my tests would pass. This way I can write additional attributes to my interface subclasses and verify the implementation, which is just a quick & easy way to detect missing or broken attributes/properties/methods.

Would be cool though if the actual node base classes would implement the contract of the interface, which would mean less work for me :)

If you agree, I could branch the node repo & add verify{Class,Object} tests, then show you which implementations are broken, then we add those implementation (or just make them return NotImplemented if they're meant to be implemented by the subclass).

Does this sound good to you guys? (to bad English doesn't have a für ihnen).

rnixx commented 13 years ago

+1 from me, sounds reasonable.

rnixx commented 2 years ago

@attilaolah Hi, i guess this issue is long outdated. I close it. If you think otherwise, please reopen ;)

attilaolah commented 2 years ago

Hahaha, yes there's no chance we can still repro this :)