From 13cda1f32ba613e1fefb80d323dfaa4fab7d45f6 Mon Sep 17 00:00:00 2001 From: Munyoki Kilyungi Date: Wed, 25 Jun 2025 14:53:53 +0300 Subject: Delete "get_unreviewed_diffs." Signed-off-by: Munyoki Kilyungi --- gn3/db/case_attributes.py | 10 ---------- tests/unit/db/test_case_attributes.py | 15 --------------- 2 files changed, 25 deletions(-) diff --git a/gn3/db/case_attributes.py b/gn3/db/case_attributes.py index dc8833b..6bb8b4b 100644 --- a/gn3/db/case_attributes.py +++ b/gn3/db/case_attributes.py @@ -79,16 +79,6 @@ def queue_edit(cursor, directory: Path, edit: CaseAttributeEdit) -> int: return review_ids -def get_unreviewed_diffs(conn: Any) -> Optional[tuple]: - """Fetch all case attributes in GN""" - with conn.cursor() as cursor: - cursor.execute( - "SELECT id, editor, json_diff_data FROM " - "caseattributes_audit WHERE status = 'review'" - ) - return cursor.fetchall() - - def insert_case_attribute_audit( conn: Any, status: str, author: str, data: str ) -> int: diff --git a/tests/unit/db/test_case_attributes.py b/tests/unit/db/test_case_attributes.py index bd6f1ce..17219c6 100644 --- a/tests/unit/db/test_case_attributes.py +++ b/tests/unit/db/test_case_attributes.py @@ -6,7 +6,6 @@ import os from pytest_mock import MockFixture from gn3.db.case_attributes import queue_edit from gn3.db.case_attributes import CaseAttributeEdit -from gn3.db.case_attributes import get_unreviewed_diffs from gn3.db.case_attributes import insert_case_attribute_audit from gn3.db.case_attributes import approve_case_attribute from gn3.db.case_attributes import reject_case_attribute @@ -31,20 +30,6 @@ def test_queue_edit(mocker: MockFixture) -> None: assert {28} == review_ids -@pytest.mark.unit_test -def test_get_unreviewed_diffs(mocker: MockFixture) -> None: - """Test that the correct query is called when fetching unreviewed - case-attributes diff""" - mock_conn = mocker.MagicMock() - with mock_conn.cursor() as cursor: - _ = get_unreviewed_diffs(mock_conn) - cursor.fetchall.return_value = ((1, "editor", "diff_data_1"),) - cursor.execute.assert_called_once_with( - "SELECT id, editor, json_diff_data FROM " - "caseattributes_audit WHERE status = 'review'" - ) - - @pytest.mark.unit_test def test_insert_case_attribute_audit(mocker: MockFixture) -> None: """Test that the updating case attributes uses the correct query""" -- cgit 1.4.1