~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_log.py

Fixed as ber Robert's review.

* bzrlib/tests/blackbox/test_log.py:
(TestLogVerbose): Refactor 'lob -v' delta format tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
219
219
        self.assertContainsRe(log, r'revno: 2\n')
220
220
        self.assertContainsRe(log, r'revno: 3\n')
221
221
 
222
 
    def test_log_short_verbose(self):
223
 
        self._prepare()
224
 
        log = self.run_bzr(['log', '--short', '-v', '-r', '1'])[0]
225
 
        # Check that we use the short status format and not the regular one
 
222
 
 
223
class TestLogVerbose(TestCaseWithTransport):
 
224
 
 
225
    def setUp(self):
 
226
        super(TestLogVerbose, self).setUp()
 
227
        tree = self.make_branch_and_tree('.')
 
228
        self.build_tree(['hello.txt'])
 
229
        tree.add('hello.txt')
 
230
        tree.commit(message='message1')
 
231
 
 
232
    def assertUseShortDeltaFormat(self, cmd):
 
233
        log = self.run_bzr(cmd)[0]
 
234
        # Check that we use the short status format
226
235
        self.assertContainsRe(log, '(?m)^A  hello.txt$')
227
236
        self.assertNotContainsRe(log, '(?m)^added:$')
228
237
 
 
238
    def assertUseLongDeltaFormat(self, cmd):
 
239
        log = self.run_bzr(cmd)[0]
 
240
        # Check that we use the long status format
 
241
        self.assertNotContainsRe(log, '(?m)^A  hello.txt$')
 
242
        self.assertContainsRe(log, '(?m)^added:$')
 
243
 
 
244
    def test_log_short_verbose(self):
 
245
        self.assertUseShortDeltaFormat(['log', '--short', '-v'])
 
246
 
229
247
    def test_log_short_verbose_verbose(self):
230
 
        self._prepare()
231
 
        log = self.run_bzr(['log', '--short', '-vv', '-r', '1'])[0]
232
 
        # Check that we use the long status format and not the short one
233
 
        self.assertNotContainsRe(log, '(?m)^A  hello.txt$')
234
 
        self.assertContainsRe(log, '(?m)^added:$')
 
248
        self.assertUseLongDeltaFormat(['log', '--short', '-vv'])
235
249
 
236
250
    def test_log_long_verbose(self):
237
 
        self._prepare()
238
 
        log = self.run_bzr(['log', '--long', '-v', '-r', '1'])[0]
239
251
        # Check that we use the long status format, ignoring the verbosity
240
252
        # level
241
 
        self.assertNotContainsRe(log, '(?m)^A  hello.txt$')
242
 
        self.assertContainsRe(log, '(?m)^added:$')
 
253
        self.assertUseLongDeltaFormat(['log', '--long', '-v'])
243
254
 
244
255
    def test_log_long_verbose_verbose(self):
245
 
        self._prepare()
246
 
        log = self.run_bzr(['log', '--long', '-vv', '-r', '1'])[0]
247
256
        # Check that we use the long status format, ignoring the verbosity
248
257
        # level
249
 
        self.assertNotContainsRe(log, '(?m)^A  hello.txt$')
250
 
        self.assertContainsRe(log, '(?m)^added:$')
 
258
        self.assertUseLongDeltaFormat(['log', '--long', '-vv'])
251
259
 
252
260
 
253
261
class TestLogMerges(TestCaseWithoutPropsHandler):