Exemplo n.º 1
0
def test_choice_type():
    variables = {'test': '42'}
    choice(variables, 'test', type=int)
    assert variables['test'] == 42
Exemplo n.º 2
0
def test_choice_type():
    variables = {'test': '42'}
    choice(variables, 'test', type=int)
    assert variables['test'] == 42
Exemplo n.º 3
0
def test_choice_callable_default(monkeypatch):
    mock = MagicMock()
    monkeypatch.setattr('clickclick.choice', mock)
    variables = {}
    choice(variables, 'test', default=lambda: 'default')
    mock.assert_called_once_with(default='default')
Exemplo n.º 4
0
def test_choice_callable_default(monkeypatch):
    mock = MagicMock()
    monkeypatch.setattr('clickclick.choice', mock)
    variables = {}
    choice(variables, 'test', default=lambda: 'default')
    mock.assert_called_once_with(default='default')