[MERGE][BUG 315737] Fix failing test when CompiledChunksToLines is not available.

Vincent Ladeuil v.ladeuil+lp at free.fr
Sat Jan 10 23:22:14 GMT 2009


>>>>> "aaron" == Aaron Bentley <aaron at aaronbentley.com> writes:

    aaron> Vincent Ladeuil wrote:
    >> Funny... I had the fix sitting on my desk, first as part of an
    >> abandoned submission, then as part as an ongoing
    >> python-2.6-and-osX-non-regression check and the bug finally got
    >> reported...
    >> 
    >> The bug is that the test forgot to call the available() method of
    >> the test feature making it succeed unconditionally.

    aaron> Thanks, that's bitten me a few times.

    aaron> bb:approve.

    aaron> The test seems odd--


You're right. The *name* is odd.

    aaron> If it's checking that chunks_to_lines is compiled, why
    aaron> doesn't it just
    aaron> requireFeature(CompiledChunksToLinesFeature)?

It can't use requireFeature because it wants to test that the
feature works whether the extension is compiled or not.

Which is still odd... I'll rename it test_osutils_binding before merging,
considering that the intent of:

        if test__chunks_to_lines.CompiledChunksToLinesFeature.available():
            from bzrlib._chunks_to_lines_pyx import chunks_to_lines
        else:
            from bzrlib._chunks_to_lines_py import chunks_to_lines
        self.assertIs(chunks_to_lines, osutils.chunks_to_lines)

is to ensure that the correct function is bound inside osutils.

John, do you agree with that ?

      Vincent



More information about the bazaar mailing list