Glossar
from utils.datetime.calendar import Date
from dataclasses import dataclass, field
@dataclass
class HealthCheckExecutionBase():
test_date : Date = field(default_factory = lambda: Date().today())
test_start : Date = None
test_end : Date = None
test_duration : int = 0
measured : bool = False
min_time : int = 0
max_time : int = 0
max_total_points : int = 0
started : bool = False
finished : bool = False
test_result : object = None
submit_failed : bool = False
def start(self):
self.test_start = Date().now()
self.started = True
def increase_exec_time(self) -> None:
second_start = Date().now()
delta = second_start - self.test_start
self.test_result.exec_time = delta.seconds
def finish(self):
self.test_end = Date().now()
self.test_duration = int((self.test_end - self.test_start).seconds)
self.finished = True
def reset(self):
self.test_end = None
self.test_duration = 0
self.finished = False
def is_due(self):
return (not self.test_start is None) and (self.test_start <= Date().now())
A
from utils.datetime.calendar import Date
from dataclasses import dataclass, field
@dataclass
class HealthCheckExecutionBase():
test_date : Date = field(default_factory = lambda: Date().today())
test_start : Date = None
test_end : Date = None
test_duration : int = 0
measured : bool = False
min_time : int = 0
max_time : int = 0
max_total_points : int = 0
started : bool = False
finished : bool = False
test_result : object = None
submit_failed : bool = False
def start(self):
self.test_start = Date().now()
self.started = True
def increase_exec_time(self) -> None:
second_start = Date().now()
delta = second_start - self.test_start
self.test_result.exec_time = delta.seconds
def finish(self):
self.test_end = Date().now()
self.test_duration = int((self.test_end - self.test_start).seconds)
self.finished = True
def reset(self):
self.test_end = None
self.test_duration = 0
self.finished = False
def is_due(self):
return (not self.test_start is None) and (self.test_start <= Date().now())
B
from utils.datetime.calendar import Date
from dataclasses import dataclass, field
@dataclass
class HealthCheckExecutionBase():
test_date : Date = field(default_factory = lambda: Date().today())
test_start : Date = None
test_end : Date = None
test_duration : int = 0
measured : bool = False
min_time : int = 0
max_time : int = 0
max_total_points : int = 0
started : bool = False
finished : bool = False
test_result : object = None
submit_failed : bool = False
def start(self):
self.test_start = Date().now()
self.started = True
def increase_exec_time(self) -> None:
second_start = Date().now()
delta = second_start - self.test_start
self.test_result.exec_time = delta.seconds
def finish(self):
self.test_end = Date().now()
self.test_duration = int((self.test_end - self.test_start).seconds)
self.finished = True
def reset(self):
self.test_end = None
self.test_duration = 0
self.finished = False
def is_due(self):
return (not self.test_start is None) and (self.test_start <= Date().now())