~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_selftest.py

  • Committer: Aaron Bentley
  • Date: 2006-06-21 20:30:51 UTC
  • mto: This revision was merged to the branch mainline in revision 1808.
  • Revision ID: abentley@panoramicfeedback.com-20060621203051-258791fb09456b01
Don't use assertNotRaises-- instead, catch BadBundle and pass

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
                          'bzrlib.no-name-yet')
51
51
 
52
52
 
53
 
class TestAssertions(TestCase):
54
 
    
55
 
    def test_assert_not_raises(self):
56
 
        class OtherException(Exception):
57
 
            pass
58
 
 
59
 
        class ThisException(Exception):
60
 
            pass
61
 
 
62
 
        def raiser(arg):
63
 
            if arg == "nothing":
64
 
                return
65
 
            if arg == "other":
66
 
                raise OtherException()
67
 
            if arg == "this":
68
 
                raise ThisException()
69
 
            
70
 
        self.assertNotRaises(ThisException, raiser, 'nothing')
71
 
        self.assertNotRaises(ThisException, raiser, 'other')
72
 
        self.assertRaises(AssertionError, 
73
 
            self.assertNotRaises, ThisException, raiser, 'this')
74
 
 
75
 
 
76
53
class MetaTestLog(TestCase):
77
54
 
78
55
    def test_logging(self):