~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Martin von Gagern
  • Date: 2010-04-20 08:47:38 UTC
  • mfrom: (5167 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5195.
  • Revision ID: martin.vgagern@gmx.net-20100420084738-ygymnqmdllzrhpfn
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
704
704
 
705
705
class TestStatusEncodings(TestCaseWithTransport):
706
706
 
 
707
    def setUp(self):
 
708
        TestCaseWithTransport.setUp(self)
 
709
        self.user_encoding = osutils._cached_user_encoding
 
710
        self.stdout = sys.stdout
 
711
 
 
712
    def tearDown(self):
 
713
        osutils._cached_user_encoding = self.user_encoding
 
714
        sys.stdout = self.stdout
 
715
        TestCaseWithTransport.tearDown(self)
 
716
 
707
717
    def make_uncommitted_tree(self):
708
718
        """Build a branch with uncommitted unicode named changes in the cwd."""
709
719
        working_tree = self.make_branch_and_tree(u'.')
717
727
        return working_tree
718
728
 
719
729
    def test_stdout_ascii(self):
720
 
        self.overrideAttr(osutils, '_cached_user_encoding', 'ascii')
 
730
        sys.stdout = StringIO()
 
731
        osutils._cached_user_encoding = 'ascii'
721
732
        working_tree = self.make_uncommitted_tree()
722
733
        stdout, stderr = self.run_bzr("status")
723
734
 
727
738
""")
728
739
 
729
740
    def test_stdout_latin1(self):
730
 
        self.overrideAttr(osutils, '_cached_user_encoding', 'latin-1')
 
741
        sys.stdout = StringIO()
 
742
        osutils._cached_user_encoding = 'latin-1'
731
743
        working_tree = self.make_uncommitted_tree()
732
744
        stdout, stderr = self.run_bzr('status')
733
745