How to use invocations - 10 common examples

To help you get started, we’ve selected a few invocations examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github pyinvoke / invocations / tests / packaging / release.py View on Github external
def returns_lexica_for_reuse(self):
            actions = Lexicon(
                changelog=Changelog.NEEDS_RELEASE,
                version=VersionFile.NEEDS_BUMP,
                tag=Tag.NEEDS_CUTTING,
            )
            found_actions, found_state = _mock_status(self)
            assert found_actions == actions
            # Spot check state, don't need to check whole thing...
            assert found_state.branch == self._branch
            assert found_state.latest_version == Version("1.1.1")
            assert found_state.tags == [Version(x) for x in self._tags]
github pyinvoke / invocations / tests / packaging / release.py View on Github external
def next_patch_of_bugfix_release(self):
        versions = _latest_and_next_version(
            Lexicon(
                {
                    "release_type": Release.BUGFIX,
                    "latest_line_release": Version("1.2.2"),
                    "latest_overall_release": Version("1.4.1"),  # realism!
                }
            )
        )
        assert versions == (Version("1.2.2"), Version("1.2.3"))
github pyinvoke / invocations / tests / packaging / release.py View on Github external
def next_patch_of_bugfix_release(self):
        versions = _latest_and_next_version(
            Lexicon(
                {
                    "release_type": Release.BUGFIX,
                    "latest_line_release": Version("1.2.2"),
                    "latest_overall_release": Version("1.4.1"),  # realism!
                }
            )
        )
        assert versions == (Version("1.2.2"), Version("1.2.3"))
github pyinvoke / invocations / tests / console.py View on Github external
def reprompts_on_bad_input(self, mock_input):
        assert confirm("O rly?") is True
        assert "I didn't understand you" in sys.stderr.getvalue()
github pyinvoke / invocations / tests / console.py View on Github external
def suffix_changes_when_assume_yes_False(self, mock_input):
        confirm("Are you sure?", assume_yes=False)
        assert mock_input.call_args[0][0] == "Are you sure? [y/N] "
github pyinvoke / invocations / tests / console.py View on Github external
def displays_question_with_yes_no_suffix(self, mock_input):
        confirm("Are you sure?")
        assert mock_input.call_args[0][0] == "Are you sure? [Y/n] "
github pyinvoke / invocations / tests / console.py View on Github external
def default_on_empty_response_is_True_by_default(self, mock_input):
        assert confirm("Are you sure?") is True
github pyinvoke / invocations / tests / console.py View on Github external
def whitespace_is_trimmed(self, mock_input):
        assert confirm("Are you sure?") is True
github pyinvoke / invocations / tests / console.py View on Github external
def default_on_empty_response_is_False_if_assume_yes_False(
        self, mock_input
    ):
        assert confirm("Are you sure?", assume_yes=False) is False
github pyinvoke / invocations / tests / console.py View on Github external
def returns_False_for_nolike_responses(self, mock_input):
        for value in ("n", "N", "no", "NO", "nO", "No"):
            mock_input.return_value = value
            assert confirm("Meh") is False