summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/UtilTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2002-06-20 00:17:18 (GMT)
committerSteven Knight <knight@baldmt.com>2002-06-20 00:17:18 (GMT)
commit01bba4cf479f99c67dcac6bc50603feccc89c457 (patch)
treea07099be95dddcfdb438e7b08b780063c8853831 /src/engine/SCons/UtilTests.py
parent81953156f0c5075d21b9d1573ead1f2e482482a6 (diff)
downloadSCons-01bba4cf479f99c67dcac6bc50603feccc89c457.zip
SCons-01bba4cf479f99c67dcac6bc50603feccc89c457.tar.gz
SCons-01bba4cf479f99c67dcac6bc50603feccc89c457.tar.bz2
Check in the Tool() interface. (SK and Charles Crain)
Diffstat (limited to 'src/engine/SCons/UtilTests.py')
-rw-r--r--src/engine/SCons/UtilTests.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/engine/SCons/UtilTests.py b/src/engine/SCons/UtilTests.py
index 4f3195f..31dceb1 100644
--- a/src/engine/SCons/UtilTests.py
+++ b/src/engine/SCons/UtilTests.py
@@ -361,6 +361,32 @@ class UtilTestCase(unittest.TestCase):
assert get_environment_var("$BAR ") == None, get_environment_var("$BAR ")
assert get_environment_var("FOO$BAR") == None, get_environment_var("FOO$BAR")
+ def test_Proxy(self):
+ """Test generic Proxy class."""
+ class Subject:
+ def foo(self):
+ return 1
+ def bar(self):
+ return 2
+
+ s=Subject()
+ s.baz = 3
+
+ class ProxyTest(Proxy):
+ def bar(self):
+ return 4
+
+ p=ProxyTest(s)
+
+ assert p.foo() == 1, p.foo()
+ assert p.bar() == 4, p.bar()
+ assert p.baz == 3, p.baz
+
+ p.baz = 5
+ s.baz = 6
+
+ assert p.baz == 5, p.baz
+
if __name__ == "__main__":
suite = unittest.makeSuite(UtilTestCase, 'test_')
if not unittest.TextTestRunner().run(suite).wasSuccessful():