diff options
Diffstat (limited to 'src/engine/SCons/ActionTests.py')
-rw-r--r-- | src/engine/SCons/ActionTests.py | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/engine/SCons/ActionTests.py b/src/engine/SCons/ActionTests.py index 9b3a949..ebc9bef 100644 --- a/src/engine/SCons/ActionTests.py +++ b/src/engine/SCons/ActionTests.py @@ -1,5 +1,5 @@ # -# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation +# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 The SCons Foundation # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the @@ -21,7 +21,7 @@ # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # -__revision__ = "src/engine/SCons/ActionTests.py 5134 2010/08/16 23:02:40 bdeegan" +__revision__ = "src/engine/SCons/ActionTests.py 5357 2011/09/09 21:31:03 bdeegan" import SCons.compat @@ -397,8 +397,12 @@ class ActionTestCase(unittest.TestCase): def test_no_action(self): """Test when the Action() factory can't create an action object """ - a5 = SCons.Action.Action(1) - assert a5 is None, a5 + try: + a5 = SCons.Action.Action(1) + except TypeError: + pass + else: + assert 0, "Should have thrown a TypeError creating Action from an int." def test_reentrance(self): """Test the Action() factory when the action is already an Action object @@ -802,6 +806,13 @@ class _ActionActionTestCase(unittest.TestCase): assert isinstance(sum.list[2], SCons.Action.CommandGeneratorAction) assert isinstance(sum.list[3], SCons.Action.FunctionAction) + # OK to add None on either side (should be ignored) + sum = act1 + None + assert sum == act1 + + sum = None + act1 + assert sum == act1 + try: sum = act2 + 1 except TypeError: |