Exemple #1
0
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')
Exemple #2
0
def test_prompt_type():
    variables = {'test': '42'}
    prompt(variables, 'test', type=int)
    assert variables['test'] == 42
Exemple #3
0
def test_prompt_type():
    variables = {'test': '42'}
    prompt(variables, 'test', type=int)
    assert variables['test'] == 42
Exemple #4
0
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')