diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2021-02-28 11:04:52 +0100 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2021-02-28 11:04:52 +0100 |
| commit | b6eb06aeee0fda77395d7b3172c44b999b70cdee (patch) | |
| tree | 9e29f32a94df7340fcc335e1740062003be393cd /minishell_test/test/result.py | |
| parent | 348da189c00bdef866d2b597ea0250fc0f0e88dc (diff) | |
| download | minishell_test-b6eb06aeee0fda77395d7b3172c44b999b70cdee.tar.gz minishell_test-b6eb06aeee0fda77395d7b3172c44b999b70cdee.tar.bz2 minishell_test-b6eb06aeee0fda77395d7b3172c44b999b70cdee.zip | |
Refactoring config in a class to have a testable environment
Diffstat (limited to 'minishell_test/test/result.py')
| -rw-r--r-- | minishell_test/test/result.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/minishell_test/test/result.py b/minishell_test/test/result.py index 87eeb5d..93c576a 100644 --- a/minishell_test/test/result.py +++ b/minishell_test/test/result.py @@ -13,7 +13,7 @@ import re from typing import Match, List, Optional -from minishell_test import config +from minishell_test.config import Config from minishell_test.test.captured import Captured @@ -42,12 +42,12 @@ class BaseResult: def __repr__(self): """Returns a representation of the result based on the verbosity""" printed = self._escaped_cmd[:] - if config.SHOW_RANGE: + if Config.show_range: printed = "{:2}: ".format(self.index) + printed - if len(printed) > config.TERM_COLS - 7: - printed = printed[:config.TERM_COLS - 10] + "..." + if len(printed) > Config.term_cols - 7: + printed = printed[:Config.term_cols - 10] + "..." fmt = self.green("{:{width}} [PASS]") if self.passed else self.red("{:{width}} [FAIL]") - return fmt.format(printed, width=config.TERM_COLS - 7) + return fmt.format(printed, width=Config.term_cols - 7) def put(self, index: int) -> None: """Print a summary of the result""" |
