userver: /data/code/userver/testsuite/pytest_plugins/pytest_userver/plugins/ydb/discover.py Source File
Loading...
Searching...
No Matches
discover.py
1import pathlib
2
3
4def find_schemas(schema_dirs: list[pathlib.Path]) -> list[pathlib.Path]:
5 result = []
6 for path in schema_dirs:
7 if not path.is_dir():
8 continue
9 result.extend(_scan_path(path))
10 return result
11
12
13def _scan_path(schema_path: pathlib.Path) -> list[pathlib.Path]:
14 result = []
15 for entry in schema_path.iterdir():
16 if entry.suffix == '.yaml' and entry.is_file():
17 result.append(entry)
18 elif entry.is_dir():
19 result.extend(_scan_path(entry))
20 return result