Ajusted tests

This commit is contained in:
Maximilien Rigaut 2022-06-02 20:37:26 +02:00
parent bbeaf96cb0
commit 8902515356
No known key found for this signature in database
GPG Key ID: 4F14B23709ADA5B1
5 changed files with 8 additions and 7 deletions

View File

@ -519,7 +519,7 @@ class ContextManager:
e.print_all()
else:
print("> " + str(e))
print("Matched elements:" + self.matched_elements)
print("Matched elements:" + str(self.matched_elements))
# Defines all methods to manage the context of the parser as a file is being parsed

View File

@ -138,7 +138,6 @@ _token_list_with_expected_result = [
]),
],
__GLk(1),
__XF,
],
[
[

View File

@ -58,9 +58,11 @@ _list_classes_expected_value = [
],
[
context_mngr.EtCustomSpanContainer([
sy.EtCustomSpanToken(["0"]),
context_mngr.TextContainer([
sy.TextToken(['test6']),
]),
sy.EtCustomSpanToken(["0"]),
]),
"<span>test6</span>",
__GLk(1),

View File

@ -616,7 +616,7 @@ list_add_tag_input_and_expected_output = [
(sy.StructuralElementEndToken(["div"]), "<se:end:div = 'div' />"),
(sy.StructuralElementStartToken(["span"]), "<se:start:span = 'span' />"),
(sy.StructuralElementEndToken(["span"]), "<se:end:span = 'span' />"),
(sy.EtCustomSpanToken(["(#12)"]), "<text:custom_span = '(#12)' />"),
(sy.EtCustomSpanToken(["(#12)"]), "<text:custom_span:(#12) />"),
(sy.HeaderToken(["#", "Text"]), "<header = '#,Text' />"),
]
@ -636,8 +636,8 @@ list_of_text_input_and_readable_output = [
"Text <text:em /> bold <text:underline /> underline <text:underline /> still bold <text:em />"),
# noqa E501 (line too long)
("[link]('http://www.google.com')", "il_link", "<hyperlink = '[link]('http://www.google.com')' />"),
("Reverse order: (#123) Span, __underline__ ~~strikethrough~~ **emphasis * Strong**", "enhanced_text",
"Reverse order: <text:custom_span = '123' /> Span, <text:underline /> underline <text:underline /> <text:strikethrough /> strikethrough <text:strikethrough /> <text:strong /> emphasis <text:em /> Strong <text:strong />"), # noqa E501 (line too long)
("Reverse order:(#123) Span, __underline__ ~~strikethrough~~ **emphasis * Strong**", "enhanced_text",
"Reverse order: <text:custom_span:123 /> Span, <text:underline /> underline <text:underline /> <text:strikethrough /> strikethrough <text:strikethrough /> <text:strong /> emphasis <text:em /> Strong <text:strong />"), # noqa E501 (line too long)
# Structural elements
("<<div", "se", "<se:start:div = 'div' />"),

View File

@ -19,14 +19,14 @@ _type_counterpart_container = [
(syntax.EtStrongToken, 'text:strong', "token", tools.__GLk(1)),
(syntax.EtUnderlineToken, 'text:underline', "token", tools.__GLk(1)),
(syntax.EtStrikethroughToken, 'text:strikethrough', "token", tools.__GLk(1)),
(syntax.EtCustomSpanToken, None, "error", tools.__GLk(1)),
(syntax.EtCustomSpanToken, "text:custom_span:test", "token", tools.__GLk(1)),
(syntax.EtUlistToken, None, "self", tools.__GLk(1)),
(syntax.EtOlistToken, None, "self", tools.__GLk(1)),
(syntax.HeaderToken, None, "self", tools.__GLk(1)),
(syntax.DisplayToken, None, "self", tools.__GLk(1)),
(syntax.StructuralElementStartToken, None, "error", tools.__GLk(1)), # A start can't be in a container (MismatchedContainerError)
(syntax.StructuralElementEndToken, 'se:start:test', "error", tools.__GLk(1)), # An end can't be in a container (MismatchedContainerError)
(syntax.HyperlinkToken, None, "error", tools.__GLk(1)), # Shouldn't be an error
(syntax.HyperlinkToken, None, "self", tools.__GLk(1)), # Shouldn't be an error
(syntax.TableToken, None, "error", tools.__GLk(1)),
(syntax.TableRowToken, None, "error", tools.__GLk(1)),
(syntax.TableCellToken, None, "error", tools.__GLk(1)),