def test_prompt_callable_default(monkeypatch): mock = MagicMock() monkeypatch.setattr('click.prompt', mock) variables = {} prompt(variables, 'test', default=lambda: 'default') mock.assert_called_once_with(default='default')
def test_prompt_type(): variables = {'test': '42'} prompt(variables, 'test', type=int) assert variables['test'] == 42