~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_transport.py

  • Committer: Patch Queue Manager
  • Date: 2011-09-12 14:54:21 UTC
  • mfrom: (6092.2.15 i18n-nulltranslations)
  • Revision ID: pqm@pqm.ubuntu.com-20110912145421-rnusbtz5vwjdpgg6
(jr) Use gettext.NullTranslations in i18n to allow use of i18n even when
 translations are not turned on. (Jonathan Riddell)

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
class TestTransport(tests.TestCase):
53
53
    """Test the non transport-concrete class functionality."""
54
54
 
 
55
    def ignore_i18n(self):
 
56
        """Some tests end up using i18n when that will break things
 
57
        (e.g. if config can no longer be read)"""
 
58
        from bzrlib import i18n
 
59
        i18n.install = lambda: None
 
60
 
55
61
    def test__get_set_protocol_handlers(self):
56
62
        handlers = transport._get_protocol_handlers()
57
63
        self.assertNotEqual([], handlers.keys())
83
89
 
84
90
    def test_transport_dependency(self):
85
91
        """Transport with missing dependency causes no error"""
 
92
        self.ignore_i18n()
86
93
        saved_handlers = transport._get_protocol_handlers()
87
94
        self.addCleanup(transport._set_protocol_handlers, saved_handlers)
88
95
        # don't pollute the current handlers