/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-09-19 01:33:10 UTC
  • mfrom: (4695.4.1 430529-extension-warnings)
  • Revision ID: pqm@pqm.ubuntu.com-20090919013310-4lds9snxescbsxed
(mbp) better messages about missing extensions

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
    errors,
30
30
    osutils,
31
31
    tests,
 
32
    trace,
32
33
    win32utils,
33
34
    )
34
35
from bzrlib.tests import (
1824
1825
        self.assertEquals(osutils._extension_load_failures[0],
1825
1826
            "No module named _fictional_extension_py")
1826
1827
 
1827
 
    def test_report_extension_load_failures(self):
 
1828
    def test_report_extension_load_failures_no_warning(self):
1828
1829
        self.assertTrue(self._try_loading())
1829
1830
        warnings, result = self.callCatchWarnings(osutils.report_extension_load_failures)
1830
 
        self.assertLength(1, warnings)
 
1831
        # it used to give a Python warning; it no longer does
 
1832
        self.assertLength(0, warnings)
 
1833
 
 
1834
    def test_report_extension_load_failures_message(self):
 
1835
        log = StringIO()
 
1836
        trace.push_log_file(log)
 
1837
        self.assertTrue(self._try_loading())
 
1838
        osutils.report_extension_load_failures()
 
1839
        self.assertContainsRe(
 
1840
            log.getvalue(),
 
1841
            r"bzr: warning: some compiled extensions could not be loaded; "
 
1842
            "see <https://answers\.launchpad\.net/bzr/\+faq/703>\n"
 
1843
            )