How to use the pygerrit2.GerritReviewMessageFormatter function in pygerrit2

To help you get started, we’ve selected a few pygerrit2 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 dpursehouse / pygerrit2 / unittests.py View on Github external
def test_message_formatting(self):
        """Test message formatter for different test cases."""
        for i, test_case in enumerate(TEST_CASES):
            self._check_test_case_fields(test_case, i)
            fmt = GerritReviewMessageFormatter(
                header=test_case["header"], footer=test_case["footer"]
            )
            for paragraph in test_case["paragraphs"]:
                fmt.append(paragraph)
            msg = fmt.format()
            self.assertEqual(
                msg,
                test_case["result"],
                "Formatted message does not match expected "
                "result in test case #%d:\n[%s]" % (i, msg),
            )
github dpursehouse / pygerrit2 / unittests.py View on Github external
def test_is_empty(self):
        """Test if message is empty for missing header and footer."""
        fmt = GerritReviewMessageFormatter(header=None, footer=None)
        self.assertTrue(fmt.is_empty())
        fmt.append(["test"])
        self.assertFalse(fmt.is_empty())