'Test for ensuring nested unregistered udts are properly inserted'

def test_can_insert_nested_unregistered_udts(self):

    c = Cluster(protocol_version=PROTOCOL_VERSION)
    s = c.connect(self.keyspace_name, wait_for_all_pools=True)
    s.row_factory = dict_factory
    MAX_NESTING_DEPTH = 16
    self.nested_udt_schema_helper(s, MAX_NESTING_DEPTH)
    udts = []
    udt = namedtuple('depth_0', ('age', 'name'))
    udts.append(udt)
    for i in range(MAX_NESTING_DEPTH):
        udt = namedtuple('depth_{0}'.format((i + 1)), 'value')
        udts.append(udt)
    for i in (0, 1, 2, 3, MAX_NESTING_DEPTH):
        udt = self.nested_udt_creation_helper(udts, i)
        insert = s.prepare('INSERT    INTO    mytable    (k,    v_{0})    VALUES    (0,    ?)'.format(i))
        s.execute(insert, [udt])
        result = s.execute('SELECT    v_{0}    FROM    mytable    WHERE    k=0'.format(i))[0]
        self.assertEqual(udt, result['v_{0}'.format(i)])
    c.shutdown()
