Skip to content

Commit 769139f

Browse files
committed
Tests for some error messages
1 parent f8c3d2f commit 769139f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/format/test_escapers.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ def test_included_html_term_from_plain(html_escaping_bundle: FluentBundle):
217217
val, errs = html_escaping_bundle.format("references-html-term-plain")
218218
assertTypeAndValueEqual(val, "\u2068-term-html\u2069 are great!")
219219
assert type(errs[0]) is TypeError
220+
assert (
221+
errs[0].args[0]
222+
== "Escaper HtmlEscaper for term -term-html cannot be used from calling context with null_escaper escaper"
223+
)
220224

221225

222226
def test_html_compound_message(html_escaping_bundle: FluentBundle):
@@ -259,6 +263,10 @@ def test_html_message_attr_reference_from_plain(html_escaping_bundle: FluentBund
259263
assertTypeAndValueEqual(val, "Plain. \u2068parent-plain.attr-html\u2069")
260264
assert len(errs) == 1
261265
assert type(errs[0]) is TypeError
266+
assert (
267+
errs[0].args[0]
268+
== "Escaper HtmlEscaper for message parent-plain.attr-html cannot be used from calling context with null_escaper escaper"
269+
)
262270

263271

264272
def test_html_message_attr_reference_from_html(html_escaping_bundle: FluentBundle):

0 commit comments

Comments
 (0)