def test_delete(self):
        # blank tests
        self.assertEqual(graph.edit_text_tree_delete('', ''), ('',0))
        self.assertEqual(graph.edit_text_tree_delete('\n', ''), ('\n',0))
        self.assertEqual(graph.edit_text_tree_delete('', 'xx'), ('',0))

        # tag not found is OK
        self.assertEqual(graph.edit_text_tree_delete(self.DEFORMED, 'XX'), (self.DEFORMED,0))

        # this one cause realignment of deformed children
        # also it invokes the final _trim_children_and_output()
        self.assertEqual(graph.edit_text_tree_delete(self.DEFORMED, 'C1'), ("""
C11
C12
   C121
  C122x
C13x
 C131
""",1))

        # this is a leaf node and affects no child
        self.assertEqual(graph.edit_text_tree_delete(self.DEFORMED, 'C11'), ("""
C1
  C12
     C121
    C122x
 C13x
  C131
""",1))
        self.assertEqual(graph.edit_text_tree_delete(self.DEFORMED, 'C12'), ("""
C1
  C11
  C121
  C122x
 C13x
  C131
""",1))
        self.assertEqual(graph.edit_text_tree_delete(self.DEFORMED, 'C131'), ("""
C1
  C11
  C12
     C121
    C122x
 C13x
""",1))

        # delete multiple occurance, alos match case insensitively
        self.assertEqual(graph.edit_text_tree_delete("""
c1
    a
c1
    b
C
    c1
        d
e
    C1
""", 'C1'), ("""
a
b
C
    d
e
""",4))
 def deleteTag(self, tag0):
     text = self.getDescription()
     edited, count = graph.edit_text_tree_delete(text, tag0)
     if count > 0:
         self.setDescription(edited)