[MERGE] Some cleanup in log tests

Vincent Ladeuil v.ladeuil+lp at free.fr
Fri May 8 14:46:34 BST 2009


>>>>> "jam" == John Arbash Meinel <john at arbash-meinel.com> writes:

    jam> Vincent Ladeuil wrote:
    >> Here are some cleanups in our log test suite.
    >> 
    >> I will follow-up with more aggressive refactoring to enhance our
    >> coverage here (we really need that).
    >> 
    >> If nobody objects, I'll merge it by next monday.
    >> 
    >> Ian, you may have some branches were that may conflict so I
    >> thought you may want a preview before I go further.
    >> 
    >> Vincent
    >> 
    >> 

    jam> ...

    jam> +class TestLogTimeZone(TestLog):
    jam> +
    jam> +    def test_log_unsupported_timezone(self):
    jam> +        self.make_linear_branch()
    jam> +        self.run_bzr_error('bzr: ERROR: Unsupported timezone format
    jam> "foo", '
    jam> +                           'options are "utc", "original", "local".',
    jam> +                           ['log', '--timezone', 'foo'])
    jam> +
    jam> +
    jam> ^- The error should be a list, not a single string. I *think* this is
    jam> actually doing a regex search for every *character* in the string you
    jam> gave...

Oh my dog ! Good catch ! And there was more than one... 6 to be precise :-/

    jam> Perhaps we should force an isintance check...

Done. More failures in other places, I'll fix them too.

I think it's worth mentioning that
bzrlib.tests.blackbox.test_push.py.TestPush.test_push_with_revisionspec
was using a *wrong* regexp there...

But that was the only one.

    jam>  class LogCatcher(log.LogFormatter):
    jam> -    """Pull log messages into list rather than displaying them.
    jam> -
    jam> -    For ease of testing we save log messages here rather than actually
    jam> -    formatting them, so that we can precisely check the result without
    jam> -    being too dependent on the exact formatting.
    jam> -
    jam> -    We should also test the LogFormatter.
    jam> +    """Pull log messages into a list rather than displaying them.
    jam> +
    jam> +    To simplify testing we save logged revisions here rather than actually
    jam> +    formatting anything, so that we can precisely check the result without
    jam> +    being dependent on the formatting.
    jam>      """

    jam>      supports_delta = True
    jam> +#    supports_merge_revisions = True


    jam> ^- This doesn't quite seem right, perhaps you want to delete the line?

Rhaaa, let's say that was the 'crocodile' of the patch, ok ? :-)
I planned further work here and forgot to delete it, thanks for
the heads-up.

    jam> This is just test changes, right?

Yes.

        Vincent



More information about the bazaar mailing list