~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Marius Kruger
  • Date: 2008-10-03 21:31:00 UTC
  • mfrom: (3763 +trunk)
  • mto: This revision was merged to the branch mainline in revision 3809.
  • Revision ID: amanic@gmail.com-20081003213100-q4rv2l9pn8qto9o0
merge with bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
import os
22
22
 
23
 
import bzrlib
 
23
from bzrlib import osutils
24
24
from bzrlib.tests.blackbox import ExternalBase
25
25
from bzrlib.tests import TestCaseInTempDir, TestCaseWithTransport
26
26
from bzrlib.tests.test_log import (
363
363
 
364
364
    def setUp(self):
365
365
        TestCaseInTempDir.setUp(self)
366
 
        self.user_encoding = bzrlib.user_encoding
 
366
        self.user_encoding = osutils._cached_user_encoding
367
367
 
368
368
    def tearDown(self):
369
 
        bzrlib.user_encoding = self.user_encoding
 
369
        osutils._cached_user_encoding = self.user_encoding
370
370
        TestCaseInTempDir.tearDown(self)
371
371
 
372
372
    def create_branch(self):
385
385
        else:
386
386
            encoded_msg = self._message.encode(encoding)
387
387
 
388
 
        old_encoding = bzrlib.user_encoding
 
388
        old_encoding = osutils._cached_user_encoding
389
389
        # This test requires that 'run_bzr' uses the current
390
390
        # bzrlib, because we override user_encoding, and expect
391
391
        # it to be used
392
392
        try:
393
 
            bzrlib.user_encoding = 'ascii'
 
393
            osutils._cached_user_encoding = 'ascii'
394
394
            # We should be able to handle any encoding
395
395
            out, err = bzr('log', encoding=encoding)
396
396
            if not fail:
401
401
            else:
402
402
                self.assertNotEqual(-1, out.find('Message with ?'))
403
403
        finally:
404
 
            bzrlib.user_encoding = old_encoding
 
404
            osutils._cached_user_encoding = old_encoding
405
405
 
406
406
    def test_log_handles_encoding(self):
407
407
        self.create_branch()
417
417
 
418
418
    def test_stdout_encoding(self):
419
419
        bzr = self.run_bzr
420
 
        bzrlib.user_encoding = "cp1251"
 
420
        osutils._cached_user_encoding = "cp1251"
421
421
 
422
422
        bzr('init')
423
423
        self.build_tree(['a'])