[MERGE] Some cleanup in log tests

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


>>>>> "Marius" == Marius Kruger <amanic at gmail.com> writes:

    Marius> hi,
    Marius> thanks a lot for this!
    Marius> (I saw john's review after I was halfway trough this 1.3k line patch,
    Marius> so I thought I'll send this in in any case)

Thanks for that.

    Marius> I think you should not delay too long with merging this,
    Marius> as it may block new log hacking until it lands.

Yes, that was the idea.

    Marius> +++ bzrlib/tests/blackbox/test_log.py    2009-05-07 17:03:30 +0000
    Marius> @@ -17,25 +17,31 @@
    Marius> ...
    Marius> +class TestLog(tests.TestCaseWithTransport):
    Marius> +
    Marius> +    def setUp(self):
    Marius> +        super(TestLog, self).setUp()
    Marius> +        self.timezone = 0 # UTC
    Marius> +        self.timestamp =1132617600 # Mon 2005-11-22 00:00:00 +0000
    Marius> ^^^ space after =

Fixed.

    Marius> @@ -45,94 +51,118 @@
    Marius> ...
    Marius> +    def check_log(self, expected, args, working_dir='level0'):
    Marius> +        out, err = self.run_bzr(['log', '--timezone', 'utc'] + args,
    Marius> +                                working_dir=working_dir)
    Marius> +        self.assertEqual('', err)
    Marius> +        self.assertEqualDiff(expected, test_log.normalize_log(out))
    Marius> +
    Marius> +
    Marius> +
    Marius> ^^^ less vertical space

Wow, you've got an eagle eye :)

    Marius> +class TestLogRevSpecs(TestLog):


    Marius> a number of these:
    Marius> +        log = self.run_bzr(['log'])[0]
    Marius> ^^^ you don't need a list: log = self.run_bzr('log')[0]   (thats just
    Marius> my preferance)

This a a long history, but roughly, when a string is used there,
it's converted into a list anyway and there are some traps. So it
was agreed that the list notation was to be preferred even if we
try hard to handle the string notation correctly.

    Marius> the tests pass and you didn't remove any AFAICT :)

I was very cautious about that yes.

By the way, 

  Vincent



More information about the bazaar mailing list