forked from soallpeach/onboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmodels.py
31 lines (24 loc) · 1001 Bytes
/
models.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
class StepResult(object):
def __init__(self, name: str, code: int, duration: int,
stdout: str, stderr: str):
self.name = name
self.code = code
self.duration = duration
self.stderr = stderr
self.stdout = stdout
def __repr__(self) -> str:
return self.name + " " + str(self.code) + " " + str(self.duration) + " " + self.stdout + " " + self.stderr
class ChallengeResult(object):
validate_result: StepResult
run_result: StepResult
build_result: StepResult
def __init__(self, build_result: StepResult, run_result: StepResult, validate_result: StepResult):
self.build_result = build_result
self.run_result = run_result
self.validate_result = validate_result
def __str__(self) -> str:
return str(self.__dict__)
class ChallengeError(Exception):
def __init__(self, message: str, step_result: StepResult):
self.message = message
self.step_result = step_result