def test_add_and_commit(mock_git):
    commit_new_version('1.0.0')
    pathfile = os.path.join('semantic_release', '__init__.py')
    mock_git.add.assert_called_once_with(pathfile)
    mock_git.commit.assert_called_once_with(
        m='1.0.0\n\nAutomatically generated by python-semantic-release',
        author="semantic-release <semantic-release>")
 def test_add_and_commit(self, mock_run):
     commit_new_version('1.0.0')
     self.assertEqual(
         mock_run.call_args_list,
         [mock.call('git add semantic_release/__init__.py', hide=True),
          mock.call('git commit -m "1.0.0"', hide=True)]
     )
def test_add_and_commit(mock_git, mocker, params):
    mocker.patch(
        "semantic_release.vcs_helpers.config.get",
        wrapped_config_get(**params["config"]),
    )

    commit_new_version(params["version"])

    for path in params["add_paths"]:
        mock_git.add.assert_any_call(path)

    mock_git.commit.assert_called_once_with(**params["commit_args"])
def test_add_and_commit_with_author(mocker, mock_git):
    orig = config.get

    def wrapped_config_get(*args, **kwargs):
        if (len(args) >= 2 and args[0] == 'semantic_release'
                and args[1] == 'commit_author'):
            return 'foo <*****@*****.**>'

        return orig(*args, **kwargs)

    mocker.patch('semantic_release.vcs_helpers.config.get', wrapped_config_get)

    commit_new_version('1.0.0')

    mock_git.commit.assert_called_once_with(
        m='1.0.0\n\nAutomatically generated by python-semantic-release',
        author='foo <*****@*****.**>')
예제 #5
0
def test_add_and_commit_with_author(mocker, mock_git):
    orig = config.get

    def wrapped_config_get(*args, **kwargs):
        if args[0] == "commit_author":
            return "foo <*****@*****.**>"

        return orig(*args, **kwargs)

    mocker.patch("semantic_release.vcs_helpers.config.get", wrapped_config_get)

    commit_new_version("1.0.0")

    mock_git.commit.assert_called_once_with(
        m="1.0.0\n\nAutomatically generated by python-semantic-release",
        author="foo <*****@*****.**>",
    )
def test_add_and_commit(mock_git):
    commit_new_version('1.0.0')
    mock_git.add.assert_called_once_with('semantic_release/__init__.py')
    mock_git.commit.assert_called_once_with(m='1.0.0', author="semantic-release <semantic-release>")
예제 #7
0
def test_add_and_commit(mock_git):
    commit_new_version('1.0.0')
    mock_git.add.assert_called_once_with('semantic_release/__init__.py')
    mock_git.commit.assert_called_once_with(
        m='1.0.0', author="semantic-release <semantic-release>")