From 6fb63b348f77d4cce29278cf06191a11a3b6d95d Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Wed, 2 Aug 2023 10:27:10 +0300 Subject: Remove ORM-dependent `insert` function Remove the object-relation-mapping dependent `insert` function to prevent it being used in the code down the line. --- tests/unit/db/test_audit.py | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 tests/unit/db/test_audit.py (limited to 'tests') diff --git a/tests/unit/db/test_audit.py b/tests/unit/db/test_audit.py deleted file mode 100644 index 884afc6..0000000 --- a/tests/unit/db/test_audit.py +++ /dev/null @@ -1,31 +0,0 @@ -"""Tests for db/phenotypes.py""" -import json -from unittest import TestCase -from unittest import mock - -import pytest - -from gn3.db import insert -from gn3.db.metadata_audit import MetadataAudit - - -class TestMetadatAudit(TestCase): - """Test cases for fetching chromosomes""" - - @pytest.mark.unit_test - def test_insert_into_metadata_audit(self): - """Test that data is inserted correctly in the audit table - - """ - db_mock = mock.MagicMock() - with db_mock.cursor() as cursor: - type(cursor).rowcount = 1 - self.assertEqual(insert( - conn=db_mock, table="metadata_audit", - data=MetadataAudit(dataset_id=35, - editor="Bonface", - json_data=json.dumps({"a": "b"}))), 1) - cursor.execute.assert_called_once_with( - "INSERT INTO metadata_audit (dataset_id, " - "editor, json_diff_data) VALUES (%s, %s, %s)", - (35, 'Bonface', '{"a": "b"}')) -- cgit v1.2.3