Ejemplo n.º 1
0
def test_git_sha_list_has_call_with_expected_command(mocker, mock_process):
    output = 'a\nb'
    mock_process.call.return_value = (output, '')
    cmd = ['git', 'log', '--reverse', '--pretty=format:%h']
    repo = Repository('path')
    result = repo.sha_list()

    assert result == output.splitlines()
    mock_process.call.assert_called_once_with(cmd, cwd=repo.path)
Ejemplo n.º 2
0
def test_git_sha_list_has_call_with_expected_command(mocker, mock_process):
    output = 'a\nb'
    mock_process.call.return_value = (output, '')
    cmd = ['git', 'log', '--reverse', '--pretty=format:%h']
    repo = Repository('path')
    result = repo.sha_list()

    assert result == output.splitlines()
    mock_process.call.assert_called_once_with(cmd, cwd=repo.path)