示例#1
0
 def test_raises_on_undeclared_children(self):
     children = _Children('test', self.dom, {}, {})
     self.assertRaises(AttributeError, lambda: children.some_section)
示例#2
0
 def test_get_declared_children(self):
     children = _Children('test', self.dom, {'anys': ('any', self.wrap)}, {})
     self.assertEqual(['any.1', 'any.2'], children.anys)
示例#3
0
 def test_get_declared_section(self):
     children = _Children(
         'test', self.dom, {}, {'some_section': ('some', self.wrap)}
     )
     self.assertEqual('some.0', children.some_section)
示例#4
0
 def test_raises_on_undeclared_children(self):
     children = _Children('test', self.dom, {}, {})
     self.assertRaises(AttributeError, lambda: children.some_section)
示例#5
0
 def test_get_declared_children(self):
     children = _Children('test', self.dom, {'anys': ('any', self.wrap)},
                          {})
     self.assertEqual(['any.1', 'any.2'], children.anys)
示例#6
0
 def test_get_declared_section(self):
     children = _Children('test', self.dom, {},
                          {'some_section': ('some', self.wrap)})
     self.assertEqual('some.0', children.some_section)