about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMunyoki Kilyungi2025-06-25 14:54:50 +0300
committerBonfaceKilz2025-07-07 07:58:31 +0300
commit45a558cd3025058d0a61fcfdcb0e301c1a3b5ec3 (patch)
tree5e28bf0a52f2969e70f96ae7e9bfcf74df424ad1
parent13cda1f32ba613e1fefb80d323dfaa4fab7d45f6 (diff)
downloadgenenetwork3-45a558cd3025058d0a61fcfdcb0e301c1a3b5ec3.tar.gz
Delete "insert_case_attribute_audit."
Signed-off-by: Munyoki Kilyungi <me@bonfacemunyoki.com>
-rw-r--r--gn3/db/case_attributes.py19
-rw-r--r--tests/unit/db/test_case_attributes.py17
2 files changed, 0 insertions, 36 deletions
diff --git a/gn3/db/case_attributes.py b/gn3/db/case_attributes.py
index 6bb8b4b..c839214 100644
--- a/gn3/db/case_attributes.py
+++ b/gn3/db/case_attributes.py
@@ -79,25 +79,6 @@ def queue_edit(cursor, directory: Path, edit: CaseAttributeEdit) -> int:
         return review_ids
 
 
-def insert_case_attribute_audit(
-    conn: Any, status: str, author: str, data: str
-) -> int:
-    """Update the case_attribute_audit table"""
-    rowcount = 0
-    try:
-        with conn.cursor() as cursor:
-            cursor.execute(
-                "INSERT INTO caseattributes_audit "
-                "(status, editor, json_diff_data) "
-                "VALUES (%s, %s, %s)",
-                (status, author, data,),
-            )
-            rowcount = cursor.rowcount
-    except Exception as _e:
-        raise MySQLdb.Error(_e) from _e
-    return rowcount
-
-
 def reject_case_attribute(conn: Any, case_attr_audit_id: int) -> int:
     """Given the id of the json_diff in the case_attribute_audit table, reject
     it"""
diff --git a/tests/unit/db/test_case_attributes.py b/tests/unit/db/test_case_attributes.py
index 17219c6..80e199a 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 insert_case_attribute_audit
 from gn3.db.case_attributes import approve_case_attribute
 from gn3.db.case_attributes import reject_case_attribute
 
@@ -31,22 +30,6 @@ def test_queue_edit(mocker: MockFixture) -> None:
 
 
 @pytest.mark.unit_test
-def test_insert_case_attribute_audit(mocker: MockFixture) -> None:
-    """Test that the updating case attributes uses the correct query"""
-    mock_conn = mocker.MagicMock()
-    with mock_conn.cursor() as cursor:
-        _ = insert_case_attribute_audit(
-            mock_conn, status="review", author="Author", data="diff_data"
-        )
-        cursor.execute.assert_called_once_with(
-            "INSERT INTO caseattributes_audit "
-            "(status, editor, json_diff_data) "
-            "VALUES (%s, %s, %s)",
-            ("review", "Author", "diff_data"),
-        )
-
-
-@pytest.mark.unit_test
 def test_reject_case_attribute(mocker: MockFixture) -> None:
     """Test rejecting a case-attribute"""
     mock_conn = mocker.MagicMock()