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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
|
'''
Dictionaries to specify structure of feature logs
'''
from enum import Enum
from typing import TypedDict
class Cmd(TypedDict):
cmd: str
class Endpoint(TypedDict):
method: str
path: str
action: str
class Interface(TypedDict):
name: str
plug_snap_type: str
slot_snap_type: str
class Status(str, Enum):
done = "Done"
undone = "Undone"
error = "Error"
class Task(TypedDict):
id: str
kind: str
snap_types: list[str]
last_status: str
class Change(TypedDict):
kind: str
snap_types: list[str]
class Ensure(TypedDict):
manager: str
function: str
class EnvVariables(TypedDict):
name: str
value: str
class TaskFeatures(TypedDict):
suite: str
task_name: str
variant: str
success: bool
cmds: list[Cmd]
endpoints: list[Endpoint]
interfaces: list[Interface]
tasks: list[Task]
changes: list[Change]
ensures: list[Ensure]
class SystemFeatures(TypedDict):
schema_version: str
system: str
scenarios: list[str]
env_variables: list[EnvVariables]
tests: list[TaskFeatures]
class CmdLogLine:
cmd = 'cmd'
class EndpointLogLine:
method = 'method'
path = 'path'
action = 'action'
class InterfaceLogLine:
interface = 'interface'
slot = 'slot'
plug = 'plug'
class EnsureLogLine:
manager = 'manager'
func = 'func'
class TaskLogLine:
task_name = 'task-name'
id = 'id'
status = 'status'
class ChangeLogLine:
kind = 'kind'
id = 'id'
|