|
| 1 | +[1mdiff --git a/app/reviews/tests/test_revert_detection.py b/app/reviews/tests/test_revert_detection.py[m |
| 2 | +[1mindex 8d4f651..863d811 100644[m |
| 3 | +[1m--- a/app/reviews/tests/test_revert_detection.py[m |
| 4 | +[1m+++ b/app/reviews/tests/test_revert_detection.py[m |
| 5 | +[36m@@ -139,7 +139,7 @@[m [mclass RevertDetectionTests(TestCase):[m |
| 6 | + [m |
| 7 | + self.assertEqual(reviewed_revisions, [])[m |
| 8 | + [m |
| 9 | +[31m- @patch("reviews.autoreview._find_reviewed_revisions_by_sha1")[m |
| 10 | +[32m+[m[32m @patch("reviews.autoreview.checks.revert_detection._find_reviewed_revisions_by_sha1")[m |
| 11 | + def test_revert_detection_approve(self, mock_find_reviewed):[m |
| 12 | + """Test revert detection when revert to reviewed content is found."""[m |
| 13 | + # Mock finding reviewed revisions[m |
| 14 | +[36m@@ -153,7 +153,7 @@[m [mclass RevertDetectionTests(TestCase):[m |
| 15 | + self.assertIn("Revert to previously reviewed content", result["message"])[m |
| 16 | + self.assertIn("abc123", result["message"])[m |
| 17 | + [m |
| 18 | +[31m- @patch("reviews.autoreview._find_reviewed_revisions_by_sha1")[m |
| 19 | +[32m+[m[32m @patch("reviews.autoreview.checks.revert_detection._find_reviewed_revisions_by_sha1")[m |
| 20 | + def test_revert_detection_block(self, mock_find_reviewed):[m |
| 21 | + """Test revert detection when no reviewed content is found."""[m |
| 22 | + # Mock no reviewed revisions found[m |
| 23 | +[36m@@ -178,7 +178,7 @@[m [mclass RevertDetectionTests(TestCase):[m |
| 24 | + [m |
| 25 | + def test_revert_detection_metadata(self):[m |
| 26 | + """Test that revert detection returns proper metadata."""[m |
| 27 | +[31m- with patch("reviews.autoreview._find_reviewed_revisions_by_sha1") as mock_find:[m |
| 28 | +[32m+[m[32m with patch("reviews.autoreview.checks.revert_detection._find_reviewed_revisions_by_sha1") as mock_find:[m |
| 29 | + mock_find.return_value = [{"sha1": "abc123"}][m |
| 30 | + [m |
| 31 | + result = _check_revert_detection(self.revision, self.client)[m |
0 commit comments