~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-07-13 19:02:12 UTC
  • mfrom: (4986.2.8 deprecation)
  • Revision ID: pqm@pqm.ubuntu.com-20100713190212-bnayd5moplwtxhhb
(mbp) change some test tearDowns to addCleanup or overrideAttr (Martin Pool)

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
 
 
717
707
    def make_uncommitted_tree(self):
718
708
        """Build a branch with uncommitted unicode named changes in the cwd."""
719
709
        working_tree = self.make_branch_and_tree(u'.')
727
717
        return working_tree
728
718
 
729
719
    def test_stdout_ascii(self):
730
 
        sys.stdout = StringIO()
731
 
        osutils._cached_user_encoding = 'ascii'
 
720
        self.overrideAttr(osutils, '_cached_user_encoding', 'ascii')
732
721
        working_tree = self.make_uncommitted_tree()
733
722
        stdout, stderr = self.run_bzr("status")
734
723
 
738
727
""")
739
728
 
740
729
    def test_stdout_latin1(self):
741
 
        sys.stdout = StringIO()
742
 
        osutils._cached_user_encoding = 'latin-1'
 
730
        self.overrideAttr(osutils, '_cached_user_encoding', 'latin-1')
743
731
        working_tree = self.make_uncommitted_tree()
744
732
        stdout, stderr = self.run_bzr('status')
745
733