How to use the pygerrit2.GerritReview 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
)
        self.assertEqual(
            str(obj3), '{"comments": {"Makefile": [{"line": 10, "message": "test"}]}}'
        )

        obj4 = GerritReview(
            labels={"Verified": 1, "Code-Review": -1},
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}],
        )
        self.assertEqual(
            str(obj4),
            '{"comments": {"Makefile": [{"line": 10, "message": "test"}]},'
            ' "labels": {"Code-Review": -1, "Verified": 1}}',
        )

        obj5 = GerritReview(
            comments=[
                {"filename": "Makefile", "line": 15, "message": "test"},
                {"filename": "Make", "line": 10, "message": "test1"},
            ]
        )
        self.assertEqual(
            str(obj5),
            '{"comments": {"Make": [{"line": 10, "message": "test1"}],'
            ' "Makefile": [{"line": 15, "message": "test"}]}}',
github dpursehouse / pygerrit2 / unittests.py View on Github external
def test_str(self):
        """Test for str function."""
        obj = GerritReview()
        self.assertEqual(str(obj), "{}")

        obj2 = GerritReview(labels={"Verified": 1, "Code-Review": -1})
        self.assertEqual(str(obj2), '{"labels": {"Code-Review": -1, "Verified": 1}}')

        obj3 = GerritReview(
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}]
        )
        self.assertEqual(
            str(obj3), '{"comments": {"Makefile": [{"line": 10, "message": "test"}]}}'
        )

        obj4 = GerritReview(
            labels={"Verified": 1, "Code-Review": -1},
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}],
        )
        self.assertEqual(
            str(obj4),
            '{"comments": {"Makefile": [{"line": 10, "message": "test"}]},'
github dpursehouse / pygerrit2 / unittests.py View on Github external
def test_str(self):
        """Test for str function."""
        obj = GerritReview()
        self.assertEqual(str(obj), "{}")

        obj2 = GerritReview(labels={"Verified": 1, "Code-Review": -1})
        self.assertEqual(str(obj2), '{"labels": {"Code-Review": -1, "Verified": 1}}')

        obj3 = GerritReview(
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}]
        )
        self.assertEqual(
            str(obj3), '{"comments": {"Makefile": [{"line": 10, "message": "test"}]}}'
        )

        obj4 = GerritReview(
            labels={"Verified": 1, "Code-Review": -1},
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}],
        )
        self.assertEqual(
            str(obj4),
            '{"comments": {"Makefile": [{"line": 10, "message": "test"}]},'
            ' "labels": {"Code-Review": -1, "Verified": 1}}',
        )

        obj5 = GerritReview(
            comments=[
                {"filename": "Makefile", "line": 15, "message": "test"},
                {"filename": "Make", "line": 10, "message": "test1"},
            ]
        )
        self.assertEqual(
github dpursehouse / pygerrit2 / unittests.py View on Github external
def test_str(self):
        """Test for str function."""
        obj = GerritReview()
        self.assertEqual(str(obj), "{}")

        obj2 = GerritReview(labels={"Verified": 1, "Code-Review": -1})
        self.assertEqual(str(obj2), '{"labels": {"Code-Review": -1, "Verified": 1}}')

        obj3 = GerritReview(
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}]
        )
        self.assertEqual(
            str(obj3), '{"comments": {"Makefile": [{"line": 10, "message": "test"}]}}'
        )

        obj4 = GerritReview(
            labels={"Verified": 1, "Code-Review": -1},
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}],
        )
        self.assertEqual(
            str(obj4),
            '{"comments": {"Makefile": [{"line": 10, "message": "test"}]},'
            ' "labels": {"Code-Review": -1, "Verified": 1}}',
        )
github dpursehouse / pygerrit2 / livetests.py View on Github external
def test_review(self, gerrit_api):
        """Test that a review can be posted by the review API."""
        change_id = self._get_test_change(gerrit_api)["id"]
        review = GerritReview()
        review.set_message("Review from live test")
        review.add_labels({"Code-Review": 1})
        review.set_tag("a_test_tag")
        result = gerrit_api.review(change_id, "current", review)
        assert "labels" in result
        assert "Code-Review" in result["labels"]
        assert result["labels"]["Code-Review"] == 1
github dpursehouse / pygerrit2 / unittests.py View on Github external
def test_str(self):
        """Test for str function."""
        obj = GerritReview()
        self.assertEqual(str(obj), "{}")

        obj2 = GerritReview(labels={"Verified": 1, "Code-Review": -1})
        self.assertEqual(str(obj2), '{"labels": {"Code-Review": -1, "Verified": 1}}')

        obj3 = GerritReview(
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}]
        )
        self.assertEqual(
            str(obj3), '{"comments": {"Makefile": [{"line": 10, "message": "test"}]}}'
        )

        obj4 = GerritReview(
            labels={"Verified": 1, "Code-Review": -1},
            comments=[{"filename": "Makefile", "line": 10, "message": "test"}],
        )