[Twisted-Python] Re: [Twisted-commits] r18549 - Clean up t.web.soap.SOAPPublisher.lookupFunction

Thomas HERVE therve at free.fr
Fri Oct 27 11:34:08 EDT 2006


Quoting Jean-Paul Calderone <exarkun at divmod.com>:

> On Thu, 26 Oct 2006 23:31:32 -0600, Jonathan Lange 
> <jml at wolfwood.twistedmatrix.com> wrote:
>> [snip]
>> +        self.assertTrue(self.publisher.lookupFunction("add"))
>> +        self.assertTrue(self.publisher.lookupFunction("fail"))
>> +        self.assertFalse(self.publisher.lookupFunction("foobar"))
>
> assertTrue?  assertFalse? :/  Why does trial have _four_ different names
> for each of these functions?

Agree. But a choice should be made, and then deprecations put on other 
names. The fact other unittest libs can use the 4 has been a criteria, 
I guess.

> Slightly more relevantly, shouldn't at least the last of these three be
> assertIdentical(..., None)?  It is a common mistake throughout Twisted
> to test for truth when the real intent is to test against None, so I'm
> mostly pointing this out in the hopes of reducing new cases of it being
> introduced in the future.

Well I do intent to test False. The fact it returns None is an 
implementation detail: we could modify lookupFunction to return '' or 
False without modifying the tests. That might no be the good decision, 
though, but the reviewer didn't scream :).

-- 
Thomas






More information about the Twisted-Python mailing list