<commit_before>from unittest import TestCase, mock

from tagversion.git import GitVersion, is_rc

RC_VERSION = '0.1.28-rc1-1-g4fafe09-feature--skip-prefix-rows'


@mock.patch('tagversion.git.sh')
class GitTestCase(TestCase):
    def _setup_version(self, *mocks):
        version_mock = mocks[0]
        version_mock.return_value = RC_VERSION

        return version_mock

    @mock.patch('tagversion.git.GitVersion.version', new_callable=mock.PropertyMock)
    def test_bump_rc(self, *mocks):
        """
        Ensures running bump results in a stable, non-rc, release<commit_msg>Add test to ensure proper rev from some version to rc<commit_after>from unittest import TestCase, mock

from tagversion.git import GitVersion, is_rc

RC_VERSION = '0.1.28-rc1-1-g4fafe09-feature--skip-prefix-rows'


@mock.patch('tagversion.git.sh')
class GitTestCase(TestCase):
    def _setup_version(self, *mocks, version=RC_VERSION):
        version_mock = mocks[0]
        version_mock.return_value = version

        return version_mock

    @mock.patch('tagversion.git.GitVersion.version', new_callable=mock.PropertyMock)
    def test_bump_to_rc(self, *mocks):
        """
        Ensures bumping to an RC properly revs version
        """
        version_mock = self._setup_version(*mocks, version='0.1.27-16-g5befeb2-feature--skip-prefix-rows')

        args = mock.Mock(calver=False, major=False, minor=False, patch=True, rc=True)

        git_version = GitVersion(args)

        new_version = git_version.bump()

        self.assertEquals([0, 1, '28-rc1'], new_version)

    @mock.patch('tagversion.git.GitVersion.version', new_callable=mock.PropertyMock)
    def test_bump_rc(self, *mocks):
        """
        Ensures running bump results in a stable, non-rc, release
{'fraction_non_alphanumeric': 0.1137009664582149, 'fraction_numerical': 0.018760659465605456, 'mean_word_length': 3.5833333333333335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4854218', 'n_tokens_mistral': 595, 'n_tokens_neox': 571, 'n_words': 116}