~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Vincent Ladeuil
  • Date: 2011-02-10 12:37:27 UTC
  • mto: This revision was merged to the branch mainline in revision 5661.
  • Revision ID: v.ladeuil+lp@free.fr-20110210123727-8e0pu4wtlt6fj7nf
thread is already a python module, avoid confusion and use cethread instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
113
113
        msg = _format_exception()
114
114
        # Even though Windows and Linux differ for 'os.rmdir', they both give
115
115
        # 'No such file' for open()
116
 
        # However it now gets translated so we can not test for a specific message
117
116
        self.assertContainsRe(msg,
118
 
            r'^bzr: ERROR: \[Errno .*\] .*nosuchfile')
 
117
            r'^bzr: ERROR: \[Errno .*\] No such file.*nosuchfile')
119
118
 
120
119
    def test_format_pywintypes_error(self):
121
120
        self.requireFeature(features.pywintypes)
129
128
        #                with errno, function name, and locale error message
130
129
        self.assertContainsRe(msg,
131
130
            r"^bzr: ERROR: \(2, 'RemoveDirectory[AW]?', .*\)")
132
 
            
133
 
    def test_format_sockets_error(self):
134
 
        try:
135
 
            import socket
136
 
            sock = socket.socket()
137
 
            sock.send("This should fail.")
138
 
        except socket.error:
139
 
            pass
140
 
        msg = _format_exception()
141
 
        
142
 
        self.assertNotContainsRe(msg,
143
 
            r"Traceback (most recent call last):")
144
131
 
145
132
    def test_format_unicode_error(self):
146
133
        try: