~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_trace.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-08 00:21:20 UTC
  • mfrom: (3453.2.11 fast-checkout2)
  • Revision ID: pqm@pqm.ubuntu.com-20080608002120-r3kcq0kxq24lhnak
Improve build_tree performance (igc, abentley)

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
        self.assertTrue(len(msg) > 0)
94
94
        self.assertEqualDiff(msg, 'bzr: ERROR: Not a branch: \"wibble\".\n')
95
95
 
96
 
    def test_report_external_import_error(self):
97
 
        """Short friendly message for missing system modules."""
98
 
        try:
99
 
            import ImaginaryModule
100
 
        except ImportError, e:
101
 
            pass
102
 
        else:
103
 
            self.fail("somehow succeeded in importing %r" % ImaginaryModule)
104
 
        msg = _format_exception()
105
 
        self.assertEqual(msg,
106
 
            'bzr: ERROR: No module named ImaginaryModule\n'
107
 
            'You may need to install this Python library separately.\n')
108
 
 
109
 
    def test_report_import_syntax_error(self):
110
 
        try:
111
 
            raise ImportError("syntax error")
112
 
        except ImportError, e:
113
 
            pass
114
 
        msg = _format_exception()
115
 
        self.assertContainsRe(msg,
116
 
            r"Traceback \(most recent call last\)")
117
 
 
118
96
    def test_trace_unicode(self):
119
97
        """Write Unicode to trace log"""
120
98
        self.log(u'the unicode character for benzene is \N{BENZENE RING}')