Exemplo n.º 1
0
def test_input_language_several_plugins():
    validator = ValidatePluginChoice(["1", PROMPT, "2"])
    patch_validator = patch("rpdk.core.init.validate_plugin_choice", validator)
    patch_input = patch("rpdk.core.init.input", return_value="2")
    with patch_validator, patch_input as mock_input:
        assert input_language() == PROMPT

    mock_input.assert_called_once()
Exemplo n.º 2
0
def test_input_language_one_plugin():
    validator = ValidatePluginChoice([PROMPT])
    with patch("rpdk.core.init.validate_plugin_choice", validator):
        assert input_language() == PROMPT
Exemplo n.º 3
0
def test_input_language_no_plugins():
    validator = ValidatePluginChoice([])
    with patch("rpdk.core.init.validate_plugin_choice", validator):
        with pytest.raises(WizardAbortError):
            input_language()