aboutsummaryrefslogtreecommitdiff
path: root/tests/unit/db/test_db.py
blob: 84dd4d073ccf2fafe3ccb7407edcf864d93f4b36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
"""Tests for db/phenotypes.py"""
from unittest import TestCase

import pytest

from gn3.db import diff_from_dict


class TestCrudMethods(TestCase):
    """Test cases for CRUD methods"""

    @pytest.mark.unit_test
    def test_diff_from_dict(self):
        """Test that a correct diff is generated"""
        self.assertEqual(diff_from_dict({"id": 1, "data": "a"},
                                        {"id": 2, "data": "b"}),
                         {"id": {"old": 1, "new": 2},
                          "data": {"old": "a", "new": "b"}})