Пример #1
0
 def test_sort(self):
     parag = Paragraph([
         'A:\n', '    E:\n', '        C: Cc\n', '        D: Dd\n',
         '    B: Bb\n'
     ])
     parag.sort()
     self.assertEqual(
         parag,
         Paragraph([
             'A:\n', '    B: Bb\n', '    E:\n', '        D: Dd\n',
             '        C: Cc\n'
         ]))
Пример #2
0
 def test_sort_2levels(self):
     parag = Paragraph(['A:\n', 'B:\n', '      C: Cc\n'])
     # print(f"parag before sort:\n{parag.lines}")
     parag.sort()
     # print(f"parag after sort:\n{parag.lines}")
     self.assertEqual(parag, Paragraph(['A:\n', 'B:\n', '      C: Cc\n']))
Пример #3
0
 def test_sort_3levels(self):
     parag = Paragraph(['A:\n', '    E:\n', '        C: Cc\n'])
     parag.sort()
     self.assertEqual(parag,
                      Paragraph(['A:\n', '    E:\n', '        C: Cc\n']))