Re: [Twisted-Python] NetstringReceiver

2010-03-29 Thread exarkun
On 11:11 am, albert.bra...@weiermayer.com wrote: >On Fri, Mar 26, 2010 at 12:08:02PM -, exar...@twistedmatrix.com >wrote: >> >>So, are you sure this is testing what you think it's testing? > >Yes. This test was already there, and it failed in unexpected ways, so >I >had to look at it quite cl

Re: [Twisted-Python] NetstringReceiver

2010-03-29 Thread Albert Brandl
On Fri, Mar 26, 2010 at 12:08:02PM -, exar...@twistedmatrix.com wrote: > > So, are you sure this is testing what you think it's testing? Yes. This test was already there, and it failed in unexpected ways, so I had to look at it quite closely. I'm not too happy about it, since it tests sever

Re: [Twisted-Python] NetstringReceiver

2010-03-28 Thread Andrew Bennetts
exar...@twistedmatrix.com wrote: > On 10:25 am, albert.bra...@weiermayer.com wrote: [...] > >There is a unittest that assumes that dataReceives still works after > >sending in garbage: > > > > def test_illegal(self): > >""" > >Assert that illegal strings cause the transport to be

Re: [Twisted-Python] NetstringReceiver

2010-03-26 Thread exarkun
On 10:25 am, albert.bra...@weiermayer.com wrote: >On Thu, Mar 25, 2010 at 09:22:03AM +1100, Andrew Bennetts wrote: >> >>No; I think once loseConnection has been called dataReceived won't be >>called again, so there's no point checking for brokenPeer in >>dataReceived. > >There is a unittest that as

Re: [Twisted-Python] NetstringReceiver

2010-03-26 Thread Albert Brandl
On Thu, Mar 25, 2010 at 09:22:03AM +1100, Andrew Bennetts wrote: > > No; I think once loseConnection has been called dataReceived won't be > called again, so there's no point checking for brokenPeer in > dataReceived. There is a unittest that assumes that dataReceives still works after sending in

Re: [Twisted-Python] NetstringReceiver

2010-03-25 Thread exarkun
On 08:36 am, albert.bra...@weiermayer.com wrote: >On Thu, Mar 25, 2010 at 09:22:03AM +1100, Andrew Bennetts wrote: >>I'm rather confused about why you're even asking this question. >>Exactly >>what API are you proposing as an alternative to the existing API >>(which >>is subclass NetstringReceive

Re: [Twisted-Python] NetstringReceiver

2010-03-25 Thread Albert Brandl
On Thu, Mar 25, 2010 at 09:22:03AM +1100, Andrew Bennetts wrote: > I'm rather confused about why you're even asking this question. Exactly > what API are you proposing as an alternative to the existing API (which > is subclass NetstringReceiver and override stringReceived, and > stringReceived wil

Re: [Twisted-Python] NetstringReceiver

2010-03-24 Thread Andrew Bennetts
Albert Brandl wrote: > Hi! > > The NetstringReceiver class does not exactly do what I'd expect - see > issue http://twistedmatrix.com/trac/ticket/4378. Since we plan to use > netstrings, I am trying to fix it. > > I am not quite sure how to handle certain problems, though, and that's > where I

[Twisted-Python] NetstringReceiver

2010-03-24 Thread Albert Brandl
Hi! The NetstringReceiver class does not exactly do what I'd expect - see issue http://twistedmatrix.com/trac/ticket/4378. Since we plan to use netstrings, I am trying to fix it. I am not quite sure how to handle certain problems, though, and that's where I'd appreciate help. If this is the wr