What is per_inventory supposed to test
John Arbash Meinel
john at arbash-meinel.com
Fri Sep 25 04:07:48 BST 2009
-----BEGIN PGP SIGNED MESSAGE-----
>> When I went to update that, I found that CHKInventory doesn't act much
>> like Inventory for many operations.
> Right. I consider per_inventory more a 'per_in_memory_inventory' test
> suite. test_inv has permutation tests for mutating operations via
> apply_delta, and other query methods that all inventories have to
So we only have 1 "memory inventory" implementation, and as such I don't
see it being particularly useful to have a 'per_inventory' that has 1
So it seemed more reasonable to change 'per_inventory' to mean 'run the
tests that different inventories should support for query methods'.
The permutations in 'test_inv.py' should really be split out into some
sort of "per_delta" sort of suite. I think they are very valuable, but
they aren't *really* testing things that claim to be Inventories.
Specifically, it is testing 'add_inventory_by_delta' across all
Repository formats, and 'update_basis_by_delta' and
'apply_inventory_delta' across all Working Tree formats.
You don't have stuff like 'filter()' on working trees, for example.
>> But it also ended up meaning that I need to move a bunch of tests out of
>> per_inventory/basics.py into 'test_inv.py' since stuff like 'add_path()'
>> will probably never be implemented.
>> Does that seem reasonable?
> I'd probably have done it the other way around. Or perhaps delete
> per_inventory altogether in favour of inline parameterisation in
If something is going to be parameterized I really prefer to do it in a
file/directory named 'per_XXX'. In fact, I'm pretty close to renaming
'test_inv' to 'test_inventory.py' at least.
Though as I just mentioned, I think a bunch of the tests in that file
don't really belong there.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
-----END PGP SIGNATURE-----
More information about the bazaar