summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ErrorsTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/ErrorsTests.py')
-rw-r--r--src/engine/SCons/ErrorsTests.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/engine/SCons/ErrorsTests.py b/src/engine/SCons/ErrorsTests.py
index c38158d..7819580 100644
--- a/src/engine/SCons/ErrorsTests.py
+++ b/src/engine/SCons/ErrorsTests.py
@@ -23,6 +23,8 @@
__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+import errno
+import os
import sys
import unittest
@@ -100,6 +102,29 @@ class ErrorsTestCase(unittest.TestCase):
except SCons.Errors.ExplicitExit as e:
assert e.node == "node"
+ def test_convert_EnvironmentError_to_BuildError(self):
+ """Test the convert_to_BuildError function on EnvironmentError
+ exceptions.
+ """
+ ee = SCons.Errors.EnvironmentError("test env error")
+ be = SCons.Errors.convert_to_BuildError(ee)
+ assert be.errstr == "test env error"
+ assert be.status == 2
+ assert be.exitstatus == 2
+ assert be.filename is None
+
+ def test_convert_OSError_to_BuildError(self):
+ """Test the convert_to_BuildError function on OSError
+ exceptions.
+ """
+ ose = OSError(7, 'test oserror')
+ be = SCons.Errors.convert_to_BuildError(ose)
+ assert be.errstr == 'test oserror'
+ assert be.status == 7
+ assert be.exitstatus == 2
+ assert be.filename is None
+
+
if __name__ == "__main__":
suite = unittest.makeSuite(ErrorsTestCase, 'test_')
TestUnit.run(suite)