~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-17 13:53:36 UTC
  • mfrom: (1939 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1940.
  • Revision ID: john@arbash-meinel.com-20060817135336-100de82962355d3b
[merge] bzr.dev 1939

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
                          )
37
37
from bzrlib.tests.TestUtil import _load_module_by_name
38
38
import bzrlib.errors as errors
 
39
from bzrlib import symbol_versioning
39
40
from bzrlib.trace import note
40
41
 
41
42
 
808
809
        self.assertEndsWith('foo', 'oo')
809
810
        self.assertRaises(AssertionError, self.assertEndsWith, 'o', 'oo')
810
811
 
 
812
    def test_assertDeprecated(self):
 
813
        def testfunc(be_deprecated):
 
814
            if be_deprecated is True:
 
815
                symbol_versioning.warn('i am deprecated', DeprecationWarning, 
 
816
                                       stacklevel=1)
 
817
        self.assertDeprecated(['i am deprecated'], testfunc, True)
 
818
        self.assertDeprecated([], testfunc, False)
 
819
        self.assertDeprecated(['i am deprecated'], testfunc, 
 
820
                              be_deprecated=True)
 
821
        self.assertDeprecated([], testfunc, be_deprecated=False)
 
822
 
811
823
 
812
824
class TestConvenienceMakers(TestCaseWithTransport):
813
825
    """Test for the make_* convenience functions."""