[MERGE] inode sorted stats in status

Robert Collins robertc at robertcollins.net
Tue Sep 2 03:36:31 BST 2008

On Tue, 2008-09-02 at 12:32 +1000, Andrew Bennetts wrote:
> If statements in test methods are a bad smell.

Are they? I think its entirely appropriate when an interface can
optionally do something that the test matches that optional capability.

Trying to avoid that makes the test not fit the code (and vice versa)
and _that_ is a bad smell.

> Why not just:
>         ...
>         read_result = self.read_dir('.')
>         # Check that the names we need are present in the second
>         # column
>         names = sorted([result[1] for result in read_result])
>         self.assertEqual(expected_names, names)

This would not check that the first column is either ALL-NONE or
NEVER-NONE, which the current condition does.

> If you separately want to assert that the _py version always fills in
> None as
> the first value, then that strikes me as something that belongs in a
> separate
> test (a test specifically for that implementation, rather than all
> read_dir
> implementations).

Of course, a check for a specific implementation is orthogonal to the
interface check.


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/20080902/f6af74a3/attachment.pgp 

More information about the bazaar mailing list