~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Matt Nordhoff
  • Date: 2009-04-04 02:50:01 UTC
  • mfrom: (4253 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4256.
  • Revision ID: mnordhoff@mattnordhoff.com-20090404025001-z1403k0tatmc8l91
Merge bzr.dev, fixing conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
# "weren't nothing promised to you.  do i look like i got a promise face?"
18
18
 
70
70
 
71
71
    def test_format_os_error(self):
72
72
        try:
 
73
            os.rmdir('nosuchfile22222')
 
74
        except OSError:
 
75
            pass
 
76
        msg = _format_exception()
 
77
        self.assertContainsRe(msg,
 
78
            r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile22222')
 
79
 
 
80
    def test_format_io_error(self):
 
81
        try:
73
82
            file('nosuchfile22222')
74
 
        except (OSError, IOError):
 
83
        except IOError:
75
84
            pass
76
85
        msg = _format_exception()
77
86
        self.assertContainsRe(msg, r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
120
129
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')
121
130
        self.assertContainsRe(self._get_log(keep_log_file=True),
122
131
                              "the unicode character for benzene is")
123
 
    
 
132
 
124
133
    def test_trace_argument_unicode(self):
125
134
        """Write a Unicode argument to the trace log"""
126
135
        mutter(u'the unicode character for benzene is %s', u'\N{BENZENE RING}')
186
195
    def test_push_log_file(self):
187
196
        """Can push and pop log file, and this catches mutter messages.
188
197
 
189
 
        This is primarily for use in the test framework. 
 
198
        This is primarily for use in the test framework.
190
199
        """
191
200
        tmp1 = tempfile.NamedTemporaryFile()
192
201
        tmp2 = tempfile.NamedTemporaryFile()