Weave.join(), and progress indicator fixes
Robert Collins
robertc at robertcollins.net
Mon Jan 30 00:13:59 GMT 2006
On Wed, 2006-01-25 at 12:06 -0600, John A Meinel wrote:
> Can I get a review?
>
> John
> =:->
> plain text document attachment (fix-weave-join.patch)
> === modified file 'bzrlib/tests/test_weave.py'
> --- bzrlib/tests/test_weave.py
> +++ bzrlib/tests/test_weave.py
> @@ -991,3 +991,64 @@
> self.assertRaises(errors.WeaveInvalidChecksum, w.check)
>
>
> +class InstrumentedWeave(Weave):
> + """Keep track of how many times functions are called."""
> +
> + _extract_count = 0
> +
> + def _extract(self, versions):
> + self._extract_count += 1
> + return Weave._extract(self, versions)
> +
This looks suspect to me - _extract_count is surely per instance not per
class.
I'd add __init__ here for clarity, even if in this case the attribute is
being set onto the instances correctly.
...
> + self.assertEqual(4, w2._extract_count)
> +
> +
> + def test_double_parent(self):
PEP8 - one line between methods.
+1 with those addressed.
Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060130/ef306f35/attachment.pgp
More information about the bazaar
mailing list