Exemplo n.º 1
0
 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})
     gerrit_api.review(change_id, "current", review)
Exemplo n.º 2
0
 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})
     gerrit_api.review(change_id, "current", review)
Exemplo n.º 3
0
    def review(self, label=None, vote=1, message=''):
        print("Posting {} review for change: {}".format(
            " {}: {}".format(label, vote) if label else '', self))
        auth = HTTPDigestAuthFromNetrc(url=GERRIT_URL)
        rest = GerritRestAPI(url=GERRIT_URL, auth=auth, verify=GERRIT_VERIFY)
        rev = GerritReview()
        rev.set_message(message)
        if label:
            rev.add_labels({label: vote})

        rest.review(self.id, self.patchset, rev)
Exemplo n.º 4
0
    def review(self, label=None, vote=1, message=''):
        print_err("Posting {} review for change: {}".format(
            " {}: {}".format(label, vote) if label else '', self))
        auth = HTTPDigestAuthFromNetrc(url=GERRIT_URL)
        rest = GerritRestAPI(url=GERRIT_URL, auth=auth, verify=GERRIT_VERIFY)
        rev = GerritReview()
        rev.set_message(message)
        if label:
            rev.add_labels({label: vote})

        rest.review(self.id, self.patchset, rev)
Exemplo n.º 5
0
 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