[merge] clean up/separate pack repository tests
John Arbash Meinel
john at arbash-meinel.com
Fri Aug 1 14:50:46 BST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> Now more than ever.
>
>
BB:tweak
+from StringIO import StringIO
^- I hesitate when I see this. I won't say it is wrong, but it leads me to
believe something else we are doing *is* wrong. We should only expect
file-like objects to be 8-bit strings, and not randomly cast themselves up to
Unicode.
Two concerns:
1) You are doing parameterized tests in a file called "test_pack_repository".
We really should have this as a "per_pack_repository" layout (I suppose just
test_per_pack_repository.py ?)
2) The list you use for scenarios is both static and hidden. Which means that
Robert's new groupcompress format won't be automatically form (static) and
can't wedge itself in if it wants to (hidden).
The old format at least wasn't 'hidden'. You could write your own subclass and
have it run the pack-implementation tests. I almost did 'resubmit' until I
realized that the old one wasn't dynamic either. I would *really* like a way
to make it so. Otherwise new formats don't automatically get tested properly.
As a quick hack, you could do pseudocode:
for formats in repository.registry:
if issubclass(format, KnitPackRepository):
ATM they all inherit from KnitPackRepo, so this would work. Though it is
probably more of a side-effect than something we should depend upon.
Anyway, at a minimum, make the scenarios something plugins can get at (a
module-level variable is probably sufficient for that.)
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFIkxS2JdeBCYSNAAMRAhGXAKCWF1wbiDx8pnVL4nrWLBp77Gxp7gCfR2My
0TbYwTGZJ+t7yywqhnSQqNQ=
=a9eP
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list