On Mon, Aug 1, 2011 at 12:01, Jelmer Vernooij <jel...@samba.org> wrote:
> On Mon, 2011-08-01 at 10:28 -0700, dborow...@google.com wrote: > > diff --git a/dulwich/tests/test_server.py b/dulwich/tests/test_server.py > > index 3e5d34a..13cf110 100644 > > --- a/dulwich/tests/test_server.py > > +++ b/dulwich/tests/test_server.py > > @@ -268,7 +268,8 @@ class ProtocolGraphWalkerTestCase(TestCase): > > self.assertEquals((None, None), _split_proto_line('', allowed)) > > > > def test_determine_wants(self): > > - self.assertRaises(GitProtocolError, > self._walker.determine_wants, {}) > > + self.assertEqual(None, self._walker.determine_wants({})) > > + self.assertEqual('None', self._walker.proto.get_received_line()) > This looks a bit odd to me and I had to look up get_received_line to > remember that the string 'None' is actually added to the buffer manually > if write_pkt_line() is called. > > The python programmer in me immediately wonders if we're calling > __repr__ on an object somewhere and writing that to a buffer. > > Could we perhaps just raise an exception in get_received_line() and > check for that? That way we can return None when write_pkt_line() is > called with None. > That ends up being cleaner. Done. > Cheers, > > Jelmer >
_______________________________________________ Mailing list: https://launchpad.net/~dulwich-users Post to : dulwich-users@lists.launchpad.net Unsubscribe : https://launchpad.net/~dulwich-users More help : https://help.launchpad.net/ListHelp