def test_git_init_creates_a_repository_on_path(mocker, mock_process): path = 'some_path' cmd = ['git', 'init', path] repo = Repository(path) repo.init() mock_process.call.assert_called_once_with(cmd)
def test_git_init_creates_a_repo_on_path_commiting_with_message(mocker): MockRepo = mocker.patch('passpie.history.Repo') path = 'some_path' message = 'Initial commit' git = Repository(path) git.init(message=message) assert MockRepo.init.called MockRepo.init.assert_called_once_with(path) MockRepo.init().git.add.assert_called_once_with(all=True) MockRepo.init().index.commit.assert_called_once_with(message)