Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
)
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"}]}}',
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"}]},'
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(
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}}',
)
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
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"}],
)