Reverted fetch_from, added fetch_equals for better documentation and simplicity.

This commit is contained in:
Ege Emir Özkan
2020-08-10 05:39:56 +03:00
parent 9cae63bfec
commit a3eed28f42
3 changed files with 25 additions and 11 deletions

View File

@@ -1,5 +1,5 @@
import unittest
from datalite import datalite, fetch_if, fetch_all, fetch_range, fetch_from
from datalite import datalite, fetch_if, fetch_all, fetch_range, fetch_from, fetch_equals
from sqlite3 import connect
from dataclasses import dataclass, asdict
from os import remove
@@ -82,8 +82,8 @@ class DatabaseFetchCalls(unittest.TestCase):
t_obj = fetch_from(FetchClass, self.objs[0].obj_id)
self.assertEqual(self.objs[0], t_obj)
def testFetchFromDif(self):
t_obj = fetch_from(FetchClass, self.objs[0].str_, 'str_')
def testFetchEquals(self):
t_obj = fetch_equals(FetchClass, 'str_', self.objs[0].str_)
self.assertEqual(self.objs[0], t_obj)
def testFetchAll(self):