def test_block_writer_nested_attributes(self):
    items = list()
    name_record = _Record.create()
    name_record.add(Slot.create_slot(Text.create_from('Name'), Text.create_from('Collie')))
    breed_record = _Record.create()
    breed_record.add(Attr.create_attr(Text.create_from('Breed'), name_record))
    dog_record = _Record.create()
    dog_record.add(Slot.create_slot(Text.create_from('Dog'), breed_record))
    species_record = _Record.create()
    species_record.add(Attr.create_attr(Text.create_from('Species'), dog_record))
    animals_record = _Record.create()
    animals_record.add(Slot.create_slot(Text.create_from('Animals'), species_record))
    items.append(Attr.create_attr(Text.create_from('Zoo'), animals_record))
    writer = _ReconWriter()
    actual = _BlockWriter._write(items, writer=writer, first=True)
    self.assertIsInstance(actual, _OutputMessage)
    self.assertEqual('@Zoo(Animals:@Species(Dog:@Breed(Name:Collie)))', actual._message)
def test_block_writer_nested_attributes(self):
    items = list()
    name_record = _Record.create()
    name_record.add(Slot.create_slot(Text.create_from('Name'), Text.create_from('Collie')))
    breed_record = _Record.create()
    breed_record.add(Attr.create_attr(Text.create_from('Breed'), name_record))
    dog_record = _Record.create()
    dog_record.add(Slot.create_slot(Text.create_from('Dog'), breed_record))
    species_record = _Record.create()
    species_record.add(Attr.create_attr(Text.create_from('Species'), dog_record))
    animals_record = _Record.create()
    animals_record.add(Slot.create_slot(Text.create_from('Animals'), species_record))
    items.append(Attr.create_attr(Text.create_from('Zoo'), animals_record))
    writer = _ReconWriter()
    actual = _BlockWriter._write(items, writer=writer, first=True)
    self.assertIsInstance(actual, _OutputMessage)
    self.assertEqual('@Zoo(Animals:@Species(Dog:@Breed(Name:Collie)))', actual._message)