← Back to team overview

dulwich-users team mailing list archive

Re: [PATCH 02/13] server: Allow cloning an empty repo.

 

On Mon, 2011-08-01 at 10:28 -0700, dborowitz@xxxxxxxxxx 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.

Cheers,

Jelmer

Attachment: signature.asc
Description: This is a digitally signed message part


Follow ups

References