Esempio n. 1
0
 def test_nomatch_followed_by_match_matches(self):
     try:
         raise Exception("You can match me")
     except message_checking_exception("nomatch") as e:
         raise AssertionError("Erroneously caught exception")
     except message_checking_exception("match") as e:
         pass
     except Exception:
         raise AssertionError("Did not catch exception")
Esempio n. 2
0
 def test_positive_match(self):
     try:
         raise Exception("You can match me")
     except message_checking_exception("match") as e:
         pass
     except Exception:
         raise AssertionError("Did not catch exception")
Esempio n. 3
0
 def test_no_match(self):
     try:
         raise Exception("You can match me")
     except message_checking_exception("nomatch") as e:
         raise AssertionError("Erroneously caught exception")
     except Exception:
         pass