From b6eb06aeee0fda77395d7b3172c44b999b70cdee Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Sun, 28 Feb 2021 11:04:52 +0100 Subject: Refactoring config in a class to have a testable environment --- minishell_test/test/result.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'minishell_test/test/result.py') 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""" -- cgit