userver: /data/code/userver/testsuite/pytest_plugins/pytest_userver/utils/tskv.py Source File
Loading...
Searching...
No Matches
tskv.py
1import typing
2
3TskvRow = typing.Dict[str, str]
4
5
6def parse_line(line: str) -> TskvRow:
7 parts = line.rstrip('\n').split('\t')
8 if parts[:1] != ['tskv']:
9 raise RuntimeError(f'Invalid tskv line: {line!r}')
10 result = {}
11 for part in parts[1:]:
12 key, value = part.split('=', 1)
13 result[key] = value
14 return result