def test_git_actions_with_semantic_yml_no_git_version(self, mock_bash): with patch( 'cloudmitigator_semantic.utilities.run_bash_command_return_error' ) as version_patch: version_patch.side_effect = ["best", []] mock_bash.side_effect = [[]] git_actions = git.GitActions() self.assertEqual(git_actions.version.version, "v0.0.0")
def test_git_actions_tag_current_repo(self, mock_bash): with patch( 'cloudmitigator_semantic.utilities.run_bash_command_return_error' ) as version_patch: version_patch.side_effect = ["minor: ", "none"] mock_bash.side_effect = [["v1.0.1"]] git_actions = git.GitActions() git_actions.tag_current_repo() version_patch.assert_called_with("git tag v1.1.0")
def test_git_actions_with_semantic_yml_matching_trigger_word_minor( self, mock_bash): with patch( 'cloudmitigator_semantic.utilities.run_bash_command_return_error' ) as version_patch: version_patch.side_effect = ["minor: ", ["v1.0.1"]] mock_bash.side_effect = [["v1.0.1"]] git_actions = git.GitActions() self.assertEqual(git_actions.version.version, "v1.1.0")
def test_version_changed_cli_call(self): git_actions = git.GitActions() runner = CliRunner() test = runner.invoke(cli.changed) self.assertEqual(test.output, str(git_actions.version.version_changed))