Added tests.

This commit is contained in:
retoor 2025-07-24 04:13:05 +02:00
parent 088035224c
commit 8b261ae8aa

6
ads.py
View File

@ -286,7 +286,7 @@ class TestAsyncDataSet(unittest.IsolatedAsyncioTestCase):
async def test_upsert_update(self):
uid = await self.connector.upsert("people", {"age": 22}, {"name": "Alice"})
await asyncio.sleep(2)
await asyncio.sleep(1.1)
uid_same = await self.connector.upsert("people", {"age": 23}, {"name": "Alice"})
self.assertEqual(uid_same, uid)
rec = await self.connector.get("people", {"uid": uid})
@ -359,7 +359,7 @@ class TestAsyncDataSet(unittest.IsolatedAsyncioTestCase):
async def test_update(self):
await self.connector.insert("people", {"name": "John Doe", "age": 30})
await asyncio.sleep(2)
await asyncio.sleep(1.1)
await self.connector.update("people", {"age": 31}, {"name": "John Doe"})
rec = await self.connector.get("people", {"name": "John Doe"})
self.assertEqual(rec["age"], 31)
@ -375,7 +375,7 @@ class TestAsyncDataSet(unittest.IsolatedAsyncioTestCase):
async def test_upsert_update(self):
uid = await self.connector.upsert("people", {"age": 22}, {"name": "Alice"})
await asyncio.sleep(2)
await asyncio.sleep(1.1)
uid_same = await self.connector.upsert("people", {"age": 23}, {"name": "Alice"})
self.assertEqual(uid_same, uid)
rec = await self.connector.get("people", {"uid": uid})