Skip to content

Commit

Permalink
Modified error message (#71)
Browse files Browse the repository at this point in the history
* Modified error message

* Output for the error message changed
  • Loading branch information
fzovpec authored Apr 23, 2024
1 parent 0de1a7e commit 07bde88
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions chat_client_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
if display_expect_string:
expect_string = display_expect_string

raise TestException(f'unexpected output at step {step}!\nExpected output:\n\n{expect_string}\n\nActual output (the last printed line): \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'unexpected output at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
except EndOfFileException:
if type(child_process.before) == 'str':
output_buffer += child_process.before
Expand All @@ -59,7 +59,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
for process in processes_to_terminate:
process.terminate(force=True)

raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output:\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')

return output_buffer

Expand Down
4 changes: 2 additions & 2 deletions dns_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
if display_expect_string:
expect_string = display_expect_string

raise TestException(f'unexpected output at step {step}!\nExpected output:\n\n{expect_string}\n\nActual output (the last printed line): \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'unexpected output at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
except EndOfFileException:
if type(child_process.before) == 'str':
output_buffer += child_process.before
Expand All @@ -51,7 +51,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
for process in processes_to_terminate:
process.terminate(force=True)

raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output:\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')

return output_buffer

Expand Down
4 changes: 2 additions & 2 deletions http_server_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
if display_expect_string:
expect_string = display_expect_string

raise TestException(f'unexpected output at step {step}!\nExpected output:\n\n{expect_string}\n\nActual output (the last printed line): \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'unexpected output at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
except EndOfFileException:
if type(child_process.before) == 'str':
output_buffer += child_process.before
Expand All @@ -62,7 +62,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
for process in processes_to_terminate:
process.terminate(force=True)

raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output:\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')

return output_buffer

Expand Down
4 changes: 2 additions & 2 deletions server_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
if display_expect_string:
expect_string = display_expect_string

raise TestException(f'unexpected output at step {step}!\nExpected output:\n\n{expect_string}\n\nActual output (the last printed line): \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'unexpected output at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
except EndOfFileException:
if type(child_process.before) == 'str':
output_buffer += child_process.before
Expand All @@ -60,7 +60,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
for process in processes_to_terminate:
process.terminate(force=True)

raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output:\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')

return output_buffer

Expand Down
4 changes: 2 additions & 2 deletions unreliable_chat_check/check.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
if display_expect_string:
expect_string = display_expect_string

raise TestException(f'unexpected output at step {step}!\nExpected output:\n\n{expect_string}\n\nActual output (the last printed line): \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'unexpected output at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
except EndOfFileException:
if type(child_process.before) == 'str':
output_buffer += child_process.before
Expand All @@ -60,7 +60,7 @@ def handle_pexpect(child_process, processes_to_terminate, expect_string, output_
for process in processes_to_terminate:
process.terminate(force=True)

raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output:\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')
raise TestException(f'program has unexpectidly terminated at step {step}!\nExpected output (to appear within a program):\n\n{expect_string}\n\nProgram\'s last printed line: \n\n{last_printed_line}\n\nTotal program output:\n\n{output_buffer}')

return output_buffer

Expand Down

0 comments on commit 07bde88

Please sign in to comment.