911b11b968d3d25aa4b9d456e9a98059abc155c2
[scons.git] / src / engine / SCons / ErrorsTests.py
1 __revision__ = "ErrorsTests.py __REVISION__ __DATE__ __DEVELOPER__"
2
3 import sys
4 import unittest
5 import SCons.Errors
6
7
8 class ErrorsTestCase(unittest.TestCase):
9     def test_InternalError(self):
10         """Test the InternalError exception."""
11         try:
12             raise SCons.Errors.InternalError, "test internal error"
13         except SCons.Errors.InternalError, e:
14             assert e.args == "test internal error"
15
16     def test_UserError(self):
17         """Test the UserError exception."""
18         try:
19             raise SCons.Errors.UserError, "test user error"
20         except SCons.Errors.UserError, e:
21             assert e.args == "test user error"
22
23
24
25 if __name__ == "__main__":
26     suite = unittest.makeSuite(ErrorsTestCase, 'test_')
27     if not unittest.TextTestRunner().run(suite).wasSuccessful():
28         sys.exit(1)