From 07bde88e319768454278ff7b6e7338f382ade728 Mon Sep 17 00:00:00 2001 From: Gleb <39743818+fzovpec@users.noreply.github.com> Date: Tue, 23 Apr 2024 22:44:23 +0200 Subject: [PATCH] Modified error message (#71) * Modified error message * Output for the error message changed --- chat_client_check/check.py | 4 ++-- dns_check/check.py | 4 ++-- http_server_check/check.py | 4 ++-- server_check/check.py | 4 ++-- unreliable_chat_check/check.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/chat_client_check/check.py b/chat_client_check/check.py index 5fdd915..e798363 100644 --- a/chat_client_check/check.py +++ b/chat_client_check/check.py @@ -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 @@ -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 diff --git a/dns_check/check.py b/dns_check/check.py index 3d98c8a..ca113bf 100644 --- a/dns_check/check.py +++ b/dns_check/check.py @@ -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 @@ -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 diff --git a/http_server_check/check.py b/http_server_check/check.py index 805afe3..8536263 100644 --- a/http_server_check/check.py +++ b/http_server_check/check.py @@ -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 @@ -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 diff --git a/server_check/check.py b/server_check/check.py index add4708..fa3b3f0 100644 --- a/server_check/check.py +++ b/server_check/check.py @@ -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 @@ -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 diff --git a/unreliable_chat_check/check.py b/unreliable_chat_check/check.py index 61500c6..c568328 100644 --- a/unreliable_chat_check/check.py +++ b/unreliable_chat_check/check.py @@ -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 @@ -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