Exemplo n.º 1
0
def test_delete_project_notexist(mock_delete, mock_get_project_id):
    result = projects.delete_project(name='testerino')
    mock_get_project_id.assert_called_once_with(None, 'testerino')
    assert not mock_delete.called
    assert not result
Exemplo n.º 2
0
 def teardown():
     projects.delete_project(id=project.id)
Exemplo n.º 3
0
def test_delete_project_name(mock_delete, mock_get_project_id):
    result = projects.delete_project(name='testerino')
    mock_get_project_id.assert_called_once_with(None, 'testerino')
    mock_delete.assert_called_once_with(id=1)
    assert result == 'SUCCESS'
Exemplo n.º 4
0
def test_delete_project_id(mock_delete, mock_get_project_id):
    result = projects.delete_project(id=1)
    mock_get_project_id.assert_called_once_with(1, None)
    mock_delete.assert_called_once_with(id=1)
    assert result == 'SUCCESS'
Exemplo n.º 5
0
 def teardown():
     projects.delete_project(id=project.id)
Exemplo n.º 6
0
def test_delete_project_name(mock_projects_api, mock_delete, mock_set_id):
    result = projects.delete_project(name='testerino')
    mock_set_id.assert_called_once_with(mock_projects_api, None, 'testerino')
    mock_delete.assert_called_once_with(id=1)
    assert result == 'SUCCESS'
Exemplo n.º 7
0
def test_delete_project_id(mock_projects_api, mock_delete, mock_set_id):
    result = projects.delete_project(id=1)
    mock_set_id.assert_called_once_with(mock_projects_api, 1, None)
    mock_delete.assert_called_once_with(id=1)
    assert result == 'SUCCESS'