diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-17 11:07:24 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-17 11:07:24 +0200 |
| commit | 4a6fb4b3f1f7209f8d56cd18fdf59860c98dc884 (patch) | |
| tree | dcb3f66074c8ca57b77a6209847730c61c68f5aa /src/test/test.py | |
| parent | 12f385695e13bbb0dd65062fa371bd914acd7862 (diff) | |
| download | minishell_test-4a6fb4b3f1f7209f8d56cd18fdf59860c98dc884.tar.gz minishell_test-4a6fb4b3f1f7209f8d56cd18fdf59860c98dc884.tar.bz2 minishell_test-4a6fb4b3f1f7209f8d56cd18fdf59860c98dc884.zip | |
Added hook list, replace double semi-colon hook for ;; errors
Diffstat (limited to 'src/test/test.py')
| -rw-r--r-- | src/test/test.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/test/test.py b/src/test/test.py index 00e5516..c37a865 100644 --- a/src/test/test.py +++ b/src/test/test.py @@ -6,7 +6,7 @@ # By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/06/16 21:48:50 by charles #+# #+# # -# Updated: 2020/09/12 17:07:22 by charles ### ########.fr # +# Updated: 2020/09/17 11:05:46 by charles ### ########.fr # # # # ############################################################################ # @@ -29,7 +29,7 @@ class Test: exports: {str: str} = {}, timeout: float = config.TIMEOUT, signal=None, - hook=None): + hook=[]): """Test class cmd: command to execute setup: command to execute before tested command @@ -47,6 +47,8 @@ class Test: self.timeout = timeout self.signal = signal self.hook = hook + if type(self.hook) is not list: + self.hook = [self.hook] def run(self): """Run the test for minishell and the reference shell and print the result out""" @@ -126,6 +128,7 @@ class Test: files_content.append(None) # sandbox.remove() - if self.hook is not None: - output = self.hook(output) + for h in self.hook: + output = h(output) + return Captured(output, process.returncode, files_content) |
