| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
|
| from __future__ import annotations |
|
|
| import os |
|
|
| from test_support.readme import extract_code_blocks, find_block |
| from test_support.runtime import get_root, run_subprocess_step |
|
|
|
|
| REPO_ROOT = get_root() |
| DATA_CONFIG_README = REPO_ROOT / "getting_started" / "data_config.md" |
|
|
| _IMPORTS = ( |
| "from gr00t.data.types import ModalityConfig, ActionConfig, ActionFormat, ActionRepresentation, ActionType\n" |
| "from gr00t.data.embodiment_tags import EmbodimentTag\n" |
| "from gr00t.configs.data.embodiment_configs import MODALITY_CONFIGS, register_modality_config\n" |
| "MODALITY_CONFIGS.pop(EmbodimentTag.NEW_EMBODIMENT.value, None)\n" |
| ) |
| _REGISTER = "register_modality_config(so100_config, embodiment_tag=EmbodimentTag.NEW_EMBODIMENT)\n" |
|
|
|
|
| def test_complete_so100_config() -> None: |
| """The complete SO-100 config example in data_config.md executes without error.""" |
| blocks = extract_code_blocks(DATA_CONFIG_README) |
| so100 = find_block(blocks, "so100_config = {", language="python", occurrence=2) |
| code = _IMPORTS + "\n" + so100.code + "\n" + _REGISTER |
| env = {**os.environ} |
| run_subprocess_step( |
| ["uv", "run", "python", "-c", code], |
| step="so100_config", |
| cwd=REPO_ROOT, |
| env=env, |
| ) |
|
|