(base_app: cmd2.Cmd)
| 2740 | |
| 2741 | |
| 2742 | def test_get_settable_choices(base_app: cmd2.Cmd) -> None: |
| 2743 | choices = base_app._get_settable_choices() |
| 2744 | assert len(choices) == len(base_app.settables) |
| 2745 | |
| 2746 | for cur_choice in choices: |
| 2747 | cur_settable = base_app.settables.get(cur_choice.text) |
| 2748 | assert cur_settable is not None |
| 2749 | |
| 2750 | # Convert fields so we can compare them |
| 2751 | str_value = str(cur_settable.value) |
| 2752 | |
| 2753 | choice_value = cur_choice.table_data[0] |
| 2754 | if isinstance(choice_value, Text): |
| 2755 | choice_value = ru.rich_text_to_string(choice_value) |
| 2756 | |
| 2757 | choice_description = cur_choice.table_data[1] |
| 2758 | if isinstance(choice_description, Text): |
| 2759 | choice_description = ru.rich_text_to_string(choice_description) |
| 2760 | |
| 2761 | assert str_value in cur_choice.display_meta |
| 2762 | assert choice_value == str_value |
| 2763 | assert choice_description == cur_settable.description |
| 2764 | |
| 2765 | |
| 2766 | def test_alias_no_subcommand(base_app) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…