def test_interface(self):
        """
        Test the interface functionality.

        @raise AssertionError: If the test fails.
        """
        class BadComponent(object):
            def foo(self):
                raise NotImplementedError()

        class BadLeaf(BadComponent):
            def __init__(self):
                pass

            def foo(self):
                pass

        composite = Composite(self.component_class)
        composite_two = Composite(BadComponent)
        composite_two.add_component(BadLeaf())

        self.assertRaises(AttributeError, composite_two.add_component, self.leaf_one)
        self.assertRaises(AttributeError, composite.add_component, composite_two)
        self.assertRaises(AttributeError, composite.add_component, BadLeaf())

        Test the interface functionality.

        @raise AssertionError: If the test fails.
        
tests/structural_tests/test_composite.py