@@ -89,13 +89,13 @@ def test_get_num_levels() -> None:
89
89
assert empty_quote_convention .num_levels == 0
90
90
91
91
one_level_quote_convention = QuoteConvention (
92
- "one-level-quote-convention " ,
92
+ "one_level_quote_convention " ,
93
93
[SingleLevelQuoteConvention ("\u201c " , "\u201d " )],
94
94
)
95
95
assert one_level_quote_convention .num_levels == 1
96
96
97
97
two_level_quote_convention = QuoteConvention (
98
- "two-level-quote-convention " ,
98
+ "two_level_quote_convention " ,
99
99
[
100
100
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
101
101
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -104,7 +104,7 @@ def test_get_num_levels() -> None:
104
104
assert two_level_quote_convention .num_levels == 2
105
105
106
106
three_level_quote_convention = QuoteConvention (
107
- "three-level-quote-convention " ,
107
+ "three_level_quote_convention " ,
108
108
[
109
109
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
110
110
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -116,7 +116,7 @@ def test_get_num_levels() -> None:
116
116
117
117
def test_get_opening_quote_at_level () -> None :
118
118
quote_convention = QuoteConvention (
119
- "test-quote-convention " ,
119
+ "test_quote_convention " ,
120
120
[
121
121
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
122
122
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -130,7 +130,7 @@ def test_get_opening_quote_at_level() -> None:
130
130
131
131
def test_get_closing_quote_at_level () -> None :
132
132
quote_convention = QuoteConvention (
133
- "test-quote-convention " ,
133
+ "test_quote_convention " ,
134
134
[
135
135
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
136
136
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -144,7 +144,7 @@ def test_get_closing_quote_at_level() -> None:
144
144
145
145
def test_get_expected_quotation_mark () -> None :
146
146
quote_convention = QuoteConvention (
147
- "test-quote-convention " ,
147
+ "test_quote_convention " ,
148
148
[
149
149
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
150
150
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -168,28 +168,28 @@ def test_includes_opening_quotation_mark() -> None:
168
168
assert not empty_quote_convention ._includes_opening_quotation_mark ("\u201c " )
169
169
170
170
positive_quote_convention1 = QuoteConvention (
171
- "positive quote convention 1 " , [SingleLevelQuoteConvention ("\u201c " , "\u201d " )]
171
+ "positive_quote_convention_1 " , [SingleLevelQuoteConvention ("\u201c " , "\u201d " )]
172
172
)
173
173
assert positive_quote_convention1 ._includes_opening_quotation_mark ("\u201c " )
174
174
175
175
negative_quote_convention1 = QuoteConvention (
176
- "negative quote convention 1 " , [SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )]
176
+ "negative_quote_convention_1 " , [SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )]
177
177
)
178
178
assert not negative_quote_convention1 ._includes_opening_quotation_mark ("\u201c " )
179
179
180
180
negative_quote_convention2 = QuoteConvention (
181
- "negative quote convention 2 " , [SingleLevelQuoteConvention ("\u201d " , "\u201c " )]
181
+ "negative_quote_convention_2 " , [SingleLevelQuoteConvention ("\u201d " , "\u201c " )]
182
182
)
183
183
assert not negative_quote_convention2 ._includes_opening_quotation_mark ("\u201c " )
184
184
185
185
positive_quote_convention2 = QuoteConvention (
186
- "positive quote convention 2 " ,
186
+ "positive_quote_convention_2 " ,
187
187
[SingleLevelQuoteConvention ("\u201c " , "\u201d " ), SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )],
188
188
)
189
189
assert positive_quote_convention2 ._includes_opening_quotation_mark ("\u201c " )
190
190
191
191
positive_quote_convention3 = QuoteConvention (
192
- "positive quote convention 3 " ,
192
+ "positive_quote_convention_3 " ,
193
193
[SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ), SingleLevelQuoteConvention ("\u201c " , "\u201d " )],
194
194
)
195
195
assert positive_quote_convention3 ._includes_opening_quotation_mark ("\u201c " )
@@ -210,34 +210,34 @@ def test_includes_closing_quotation_mark() -> None:
210
210
assert not empty_quote_convention ._includes_closing_quotation_mark ("\u201d " )
211
211
212
212
positive_quote_convention1 = QuoteConvention (
213
- "positive quote convention 1 " , [SingleLevelQuoteConvention ("\u201c " , "\u201d " )]
213
+ "positive_quote_convention_1 " , [SingleLevelQuoteConvention ("\u201c " , "\u201d " )]
214
214
)
215
215
assert positive_quote_convention1 ._includes_closing_quotation_mark ("\u201d " )
216
216
217
217
negative_quote_convention1 = QuoteConvention (
218
- "negative quote convention 1 " , [SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )]
218
+ "negative_quote_convention_1 " , [SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )]
219
219
)
220
220
assert not negative_quote_convention1 ._includes_closing_quotation_mark ("\u201d " )
221
221
222
222
negative_quote_convention2 = QuoteConvention (
223
- "negative quote convention 2 " , [SingleLevelQuoteConvention ("\u201d " , "\u201c " )]
223
+ "negative_quote_convention_2 " , [SingleLevelQuoteConvention ("\u201d " , "\u201c " )]
224
224
)
225
225
assert not negative_quote_convention2 ._includes_closing_quotation_mark ("\u201d " )
226
226
227
227
positive_quote_convention2 = QuoteConvention (
228
- "positive quote convention 2 " ,
228
+ "positive_quote_convention_2 " ,
229
229
[SingleLevelQuoteConvention ("\u201c " , "\u201d " ), SingleLevelQuoteConvention ("\u2018 " , "\u2019 " )],
230
230
)
231
231
assert positive_quote_convention2 ._includes_closing_quotation_mark ("\u201d " )
232
232
233
233
positive_quote_convention3 = QuoteConvention (
234
- "positive quote convention 3 " ,
234
+ "positive_quote_convention_3 " ,
235
235
[SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ), SingleLevelQuoteConvention ("\u201c " , "\u201d " )],
236
236
)
237
237
assert positive_quote_convention3 ._includes_closing_quotation_mark ("\u201d " )
238
238
239
239
negative_quote_convention3 = QuoteConvention (
240
- "negative quote convention 3 " ,
240
+ "negative_quote_convention_3 " ,
241
241
[
242
242
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
243
243
SingleLevelQuoteConvention ("'" , "'" ),
@@ -249,7 +249,7 @@ def test_includes_closing_quotation_mark() -> None:
249
249
250
250
def test_get_possible_depths () -> None :
251
251
quote_convention = QuoteConvention (
252
- "test-quote-convention " ,
252
+ "test_quote_convention " ,
253
253
[
254
254
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
255
255
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -271,7 +271,7 @@ def test_get_possible_depths() -> None:
271
271
272
272
def test_is_compatible_with_observed_quotation_marks () -> None :
273
273
quote_convention = QuoteConvention (
274
- "test-quote-convention " ,
274
+ "test_quote_convention " ,
275
275
[
276
276
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
277
277
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -302,7 +302,7 @@ def test_normalize() -> None:
302
302
assert normalized_empty_quote_convention .num_levels == 0
303
303
304
304
standard_english_quote_convention = QuoteConvention (
305
- "standard-english-quote-convention " ,
305
+ "standard_english_quote_convention " ,
306
306
[
307
307
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
308
308
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
@@ -311,7 +311,7 @@ def test_normalize() -> None:
311
311
],
312
312
)
313
313
normalized_standard_english_quote_convention = standard_english_quote_convention .normalize ()
314
- assert normalized_standard_english_quote_convention .name == "standard-english-quote-convention_normalized "
314
+ assert normalized_standard_english_quote_convention .name == "standard_english_quote_convention_normalized "
315
315
assert normalized_standard_english_quote_convention .num_levels == 4
316
316
assert normalized_standard_english_quote_convention .get_opening_quotation_mark_at_depth (1 ) == '"'
317
317
assert normalized_standard_english_quote_convention .get_closing_quotation_mark_at_depth (1 ) == '"'
@@ -323,15 +323,15 @@ def test_normalize() -> None:
323
323
assert normalized_standard_english_quote_convention .get_closing_quotation_mark_at_depth (4 ) == "'"
324
324
325
325
western_european_quote_convention = QuoteConvention (
326
- "test-quote-convention " ,
326
+ "test_quote_convention " ,
327
327
[
328
328
SingleLevelQuoteConvention ("\u201c " , "\u201d " ),
329
329
SingleLevelQuoteConvention ("\u00ab " , "\u00bb " ),
330
330
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
331
331
],
332
332
)
333
333
normalized_western_european_quote_convention = western_european_quote_convention .normalize ()
334
- assert normalized_western_european_quote_convention .name == "test-quote-convention_normalized "
334
+ assert normalized_western_european_quote_convention .name == "test_quote_convention_normalized "
335
335
assert normalized_western_european_quote_convention .num_levels == 3
336
336
assert normalized_western_european_quote_convention .get_opening_quotation_mark_at_depth (1 ) == '"'
337
337
assert normalized_western_european_quote_convention .get_closing_quotation_mark_at_depth (1 ) == '"'
@@ -341,7 +341,7 @@ def test_normalize() -> None:
341
341
assert normalized_western_european_quote_convention .get_closing_quotation_mark_at_depth (3 ) == "'"
342
342
343
343
hybrid_british_typewriter_english_quote_convention = QuoteConvention (
344
- "hybrid-british-typewriter-english-quote-convention " ,
344
+ "hybrid_british_typewriter_english_quote_convention " ,
345
345
[
346
346
SingleLevelQuoteConvention ("\u00ab " , "\u00bb " ),
347
347
SingleLevelQuoteConvention ("'" , "'" ),
@@ -354,7 +354,7 @@ def test_normalize() -> None:
354
354
)
355
355
assert (
356
356
normalized_hybrid_british_typewriter_english_quote_convention .name
357
- == "hybrid-british-typewriter-english-quote-convention_normalized "
357
+ == "hybrid_british_typewriter_english_quote_convention_normalized "
358
358
)
359
359
assert normalized_hybrid_british_typewriter_english_quote_convention .num_levels == 3
360
360
assert normalized_hybrid_british_typewriter_english_quote_convention .get_opening_quotation_mark_at_depth (1 ) == '"'
@@ -367,15 +367,15 @@ def test_normalize() -> None:
367
367
368
368
def test_print_summary () -> None :
369
369
quote_convention = QuoteConvention (
370
- "test-quote-convention " ,
370
+ "test_quote_convention " ,
371
371
[
372
372
SingleLevelQuoteConvention ("\u201c " , "\u201D " ),
373
373
SingleLevelQuoteConvention ("\u2018 " , "\u2019 " ),
374
374
SingleLevelQuoteConvention ("\u201D " , "\u201D " ),
375
375
],
376
376
)
377
377
expected_summary_message = (
378
- "test-quote-convention \n "
378
+ "test_quote_convention \n "
379
379
+ "\u201C First-level quote\u201D \n "
380
380
+ "\u2018 Second-level quote\u2019 \n "
381
381
+ "\u201D Third-level quote\u201D \n "
0 commit comments