##// END OF EJS Templates
Added tests to make sure that components are getting parent class config.
Brian Granger -
Show More
@@ -172,6 +172,26 b' class TestComponentConfig(TestCase):'
172 self.assertEquals(c4.a, 1)
172 self.assertEquals(c4.a, 1)
173 self.assertEquals(c4.b, 1.0)
173 self.assertEquals(c4.b, 1.0)
174
174
175 def test_parent(self):
176 class Foo(Component):
177 a = Int(0, config=True)
178 b = Str('nope', config=True)
179 class Bar(Foo):
180 b = Str('gotit', config=False)
181 c = Float(config=True)
182 config = Config()
183 config.Foo.a = 10
184 config.Foo.b = "wow"
185 config.Bar.b = 'later'
186 config.Bar.c = 100.0
187 f = Foo(None, config=config)
188 b = Bar(f)
189 self.assertEquals(f.a, 10)
190 self.assertEquals(f.b, 'wow')
191 self.assertEquals(b.b, 'gotit')
192 self.assertEquals(b.c, 100.0)
193
194
175 class TestComponentName(TestCase):
195 class TestComponentName(TestCase):
176
196
177 def test_default(self):
197 def test_default(self):
General Comments 0
You need to be logged in to leave comments. Login now