~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/commands/test_cat.py

  • Committer: Martin
  • Date: 2010-05-25 17:27:52 UTC
  • mfrom: (5254 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5257.
  • Revision ID: gzlist@googlemail.com-20100525172752-amm089xcikv968sw
Merge bzr.dev to unite with similar changes already made

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2009, 2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
25
25
 
26
26
    def setUp(self):
27
27
        super(TestCat, self).setUp()
28
 
 
29
 
        def restore_stdout():
30
 
            sys.stdout = self._stdout_orig
31
 
 
32
28
        # Redirect sys.stdout as this is what cat uses
33
29
        self.outf = StringIOWrapper()
34
 
        self._stdout_orig = sys.stdout
35
 
        sys.stdout = self.outf
36
 
        self.addCleanup(restore_stdout)
 
30
        self.overrideAttr(sys, 'stdout', self.outf)
37
31
 
38
32
    def test_cat(self):
39
33
        # FIXME: sftp raises ReadError instead of NoSuchFile when probing for