Exemple #1
0
def test_remove_dependency_ids(mock_configs_api, mock_remove_dependency,
                               mock_set_id):
    result = buildconfigurations.remove_dependency(id=1, dependency_id=2)
    calls = [call(mock_configs_api, 1, None), call(mock_configs_api, 2, None)]
    mock_set_id.assert_has_calls(calls)
    mock_remove_dependency.assert_called_once_with(id=1, dependency_id=2)
    assert result == 'SUCCESS'
Exemple #2
0
def test_remove_dependency_names(mock_configs_api, mock_remove_dependency,
                                 mock_set_id):
    result = buildconfigurations.remove_dependency(name='testerino',
                                                   dependency_name='testerino')
    calls = [
        call(mock_configs_api, None, 'testerino'),
        call(mock_configs_api, None, 'testerino')
    ]
    mock_set_id.assert_has_calls(calls)
    mock_remove_dependency.assert_called_once_with(id=1, dependency_id=2)
    assert result == 'SUCCESS'
def test_remove_dependency_no_dep(mock_remove_dependency, mock_get_config_id):
    result = buildconfigurations.remove_dependency(id=1, dependency_id=2)
    calls = [call(1, None), call(2, None)]
    mock_get_config_id.assert_has_calls(calls)
    assert not mock_remove_dependency.called
    assert not result
def test_remove_dependency_no_conf(mock_remove_dependency, mock_get_config_id):
    result = buildconfigurations.remove_dependency(id=1, dependency_id=2)
    mock_get_config_id.assert_called_once_with(1, None)
    assert not mock_remove_dependency.called
    assert not result
def test_remove_dependency_names(mock_remove_dependency, mock_get_config_id):
    result = buildconfigurations.remove_dependency(name='testerino', dependency_name='testerino')
    calls = [call(None, 'testerino'), call(None, 'testerino')]
    mock_get_config_id.assert_has_calls(calls)
    mock_remove_dependency.assert_called_once_with(id=1, dependency_id=2)
    assert result == 'SUCCESS'
def test_remove_dependency_ids(mock_remove_dependency, mock_get_config_id):
    result = buildconfigurations.remove_dependency(id=1, dependency_id=2)
    calls = [call(1, None), call(2, None)]
    mock_get_config_id.assert_has_calls(calls)
    mock_remove_dependency.assert_called_once_with(id=1, dependency_id=2)
    assert result == 'SUCCESS'
def test_remove_dependency_no_conf_id_or_name(mock_remove_dependency, mock_get_config_id):
    result = buildconfigurations.remove_dependency(id=None, name=None)
    assert not mock_get_config_id.called
    assert not mock_remove_dependency.called
    assert not result