elif name == 'builder':
return self.method
else:
- return self.__dict__[name]
+ raise AttributeError, name
def __setattr__(self, name, value):
if name == 'env':
assert called_it['target'] == None, called_it
assert called_it['source'] == None, called_it
+ def test_BuilderWrapper_attributes(self):
+ """Test getting and setting of BuilderWrapper attributes
+ """
+ b1 = Builder()
+ b2 = Builder()
+ e1 = Environment()
+ e2 = Environment()
+
+ e1.Replace(BUILDERS = {'b' : b1})
+ bw = e1.b
+
+ assert bw.env is e1
+ bw.env = e2
+ assert bw.env is e2
+
+ assert bw.builder is b1
+ bw.builder = b2
+ assert bw.builder is b2
+ self.assertRaises(AttributeError, getattr, bw, 'foobar')
+ bw.foobar = 42
+ assert bw.foobar is 42
# This unit test is currently disabled because we don't think the
# underlying method it tests (Environment.BuilderWrapper.execute())