Skip to content

Commit

Permalink
squash: fix test?
Browse files Browse the repository at this point in the history
  • Loading branch information
happz committed Nov 1, 2024
1 parent c2295ff commit 4dcd596
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions tests/unit/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1792,30 +1792,34 @@ def test_create_link_relation(self, mock_config_tree, mock_add_simple_link) -> N


def test_render_command_report_output():
delimiter = (tmt.utils.OUTPUT_WIDTH - 1) * '~'

assert '\n'.join(tmt.utils.render_command_report(
label='foo',
command=ShellScript('/bar/baz'),
output=tmt.utils.CommandOutput(
stdout='This is some stdout',
stderr='This is some stderr'
)
)) == """## foo
)) == f"""## foo
# /bar/baz
# stdout (1 lines)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
This is some stdout
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
# stderr (1 lines)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
This is some stderr
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
"""


def test_render_command_report_exception():
delimiter = (tmt.utils.OUTPUT_WIDTH - 1) * '~'

assert '\n'.join(tmt.utils.render_command_report(
label='foo',
command=ShellScript('/bar/baz'),
Expand All @@ -1826,19 +1830,19 @@ def test_render_command_report_exception():
stdout='This is some stdout',
stderr='This is some stderr'
)
)) == """## foo
)) == f"""## foo
# /bar/baz
# stdout (1 lines)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
This is some stdout
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
# stderr (1 lines)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
This is some stderr
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#{delimiter}
"""


Expand Down

0 comments on commit 4dcd596

Please sign in to comment.