def test_entity_to_graph_class_hierarchy(self):

    class TestBase(object):

        def __init__(self, x='base'):
            self.x = x

        def foo(self):
            return self.x

        def bar(self):
            return self.x

    class TestSubclass(TestBase):

        def __init__(self, y):
            super(TestSubclass, self).__init__('sub')
            self.y = y

        def foo(self):
            return self.y

        def baz(self):
            return self.y
    program_ctx = self._simple_program_ctx()
    with self.assertRaisesRegex(NotImplementedError, 'classes.*whitelisted'):
        conversion.entity_to_graph(TestSubclass, program_ctx, None, None)
def test_entity_to_graph_class_hierarchy(self):

    class TestBase(object):

        def __init__(self, x='base'):
            self.x = x

        def foo(self):
            return self.x

        def bar(self):
            return self.x

    class TestSubclass(TestBase):

        def __init__(self, y):
            super(TestSubclass, self).__init__('sub')
            self.y = y

        def foo(self):
            return self.y

        def baz(self):
            return self.y
    program_ctx = self._simple_program_ctx()
    with self.assertRaisesRegex(NotImplementedError, 'classes.*whitelisted'):
        conversion.entity_to_graph(TestSubclass, program_ctx, None, None)