From 6100010d6873845413aed22744470616992df603 Mon Sep 17 00:00:00 2001 From: Charles Cabergs Date: Mon, 5 Oct 2020 14:04:41 +0200 Subject: Readded should be dead test --- src/philo/log.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/philo/log.py') diff --git a/src/philo/log.py b/src/philo/log.py index 14bdd75..a07b734 100644 --- a/src/philo/log.py +++ b/src/philo/log.py @@ -6,14 +6,15 @@ # By: cacharle +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2020/10/01 10:51:39 by cacharle #+# #+# # -# Updated: 2020/10/01 14:19:29 by cacharle ### ########.fr # +# Updated: 2020/10/05 13:52:51 by cacharle ### ########.fr # # # # ############################################################################ # import re -from .event import Event -from . import error +from philo.event import Event +import philo + class Log: def __init__(self, line: str, philo_num, start_time, end_time): @@ -24,7 +25,7 @@ class Log: line ) if match is None: - raise error.Format(line, "wrong format") + raise philo.error.Format(line, "wrong format") self._line = line self.id = self._parse_ranged_int(match.group("id"), 1, philo_num) @@ -37,10 +38,12 @@ class Log: try: value = int(s) if not (lo <= value <= hi): - raise error.Format(self._line, - "{} should be between {} - {}".format(s, lo, hi)) + raise philo.error.Format( + self._line, + "{} should be between {} - {}".format(s, lo, hi) + ) except ValueError: - raise error.Format(self._line, "{} sould be an integer".format(s)) + raise philo.error.Format(self._line, "{} sould be an integer".format(s)) return value def __repr__(self): -- cgit