Total Complexity | 4 |
Total Lines | 148 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from unittest import TestCase |
||
2 | |||
3 | from .helper import verify_conversion |
||
4 | |||
5 | |||
6 | class NumberingTests(TestCase): |
||
7 | def test_numbering_classes(self): |
||
8 | verify_conversion( |
||
9 | self, |
||
10 | r""" |
||
11 | --- |
||
12 | pandoc-numbering: |
||
13 | exercise: |
||
14 | general: |
||
15 | classes: |
||
16 | - myclass |
||
17 | --- |
||
18 | |||
19 | Exercise # |
||
20 | |||
21 | Exercise (Title) # |
||
22 | """, |
||
23 | r""" |
||
24 | --- |
||
25 | pandoc-numbering: |
||
26 | exercise: |
||
27 | general: |
||
28 | classes: |
||
29 | - myclass |
||
30 | --- |
||
31 | |||
32 | [**Exercise 1**]{#exercise:1 .pandoc-numbering-text .myclass} |
||
33 | |||
34 | []{#exercise:title}[**Exercise 2** *(Title)*]{#exercise:2 .pandoc-numbering-text .myclass} |
||
35 | """, |
||
36 | ) |
||
37 | |||
38 | def test_numbering_text(self): |
||
39 | verify_conversion( |
||
40 | self, |
||
41 | r""" |
||
42 | --- |
||
43 | pandoc-numbering: |
||
44 | exercise: |
||
45 | standard: |
||
46 | format-text-classic: '**%D %d %n/%c**' |
||
47 | format-text-title: '**%D %d %n/%c: %T %t**' |
||
48 | --- |
||
49 | |||
50 | Exercise # |
||
51 | |||
52 | Exercise (Title) # |
||
53 | """, |
||
54 | r""" |
||
55 | --- |
||
56 | pandoc-numbering: |
||
57 | exercise: |
||
58 | standard: |
||
59 | format-text-classic: "**%D %d %n/%c**" |
||
60 | format-text-title: "**%D %d %n/%c: %T %t**" |
||
61 | --- |
||
62 | |||
63 | [**Exercise exercise 1/2**]{#exercise:1 .pandoc-numbering-text .exercise} |
||
64 | |||
65 | []{#exercise:title}[**Exercise exercise 2/2: Title title**]{#exercise:2 .pandoc-numbering-text .exercise} |
||
66 | """, |
||
67 | ) |
||
68 | |||
69 | def test_numbering_levels(self): |
||
70 | verify_conversion( |
||
71 | self, |
||
72 | r""" |
||
73 | --- |
||
74 | pandoc-numbering: |
||
75 | exercise: |
||
76 | general: |
||
77 | first-section-level: 2 |
||
78 | last-section-level: 2 |
||
79 | --- |
||
80 | |||
81 | First chapter |
||
82 | ============= |
||
83 | |||
84 | Second chapter |
||
85 | ============== |
||
86 | |||
87 | First section |
||
88 | ------------- |
||
89 | |||
90 | Second section |
||
91 | -------------- |
||
92 | |||
93 | Exercise # |
||
94 | |||
95 | Exercise (Title) # |
||
96 | """, |
||
97 | r""" |
||
98 | --- |
||
99 | pandoc-numbering: |
||
100 | exercise: |
||
101 | general: |
||
102 | first-section-level: 2 |
||
103 | last-section-level: 2 |
||
104 | --- |
||
105 | |||
106 | # First chapter |
||
107 | |||
108 | # Second chapter |
||
109 | |||
110 | ## First section |
||
111 | |||
112 | ## Second section |
||
113 | |||
114 | []{#exercise:second-chapter.second-section.1}[**Exercise 2.1**]{#exercise:2.2.1 .pandoc-numbering-text .exercise} |
||
115 | |||
116 | []{#exercise:second-chapter.second-section.title}[**Exercise 2.2** *(Title)*]{#exercise:2.2.2 .pandoc-numbering-text .exercise} |
||
117 | """, |
||
118 | ) |
||
119 | |||
120 | def test_numbering_sectioning(self): |
||
121 | verify_conversion( |
||
122 | self, |
||
123 | r""" |
||
124 | --- |
||
125 | pandoc-numbering: |
||
126 | exercise: |
||
127 | general: |
||
128 | sectioning-levels: '-.+.' |
||
129 | --- |
||
130 | |||
131 | First chapter |
||
132 | ============= |
||
133 | |||
134 | Second chapter |
||
135 | ============== |
||
136 | |||
137 | First section |
||
138 | ------------- |
||
139 | |||
140 | Second section |
||
141 | -------------- |
||
142 | |||
143 | Exercise # |
||
144 | |||
145 | Exercise (Title) # |
||
146 | """, |
||
147 | r""" |
||
148 | --- |
||
168 |