Python: Add tests for aiopg

This commit is contained in:
Rasmus Lerchedahl Petersen
2021-11-09 11:49:31 +01:00
parent 330c2c42b5
commit cb8f1b4593
3 changed files with 21 additions and 0 deletions

View File

@@ -0,0 +1,2 @@
import python
import experimental.meta.ConceptsTest

View File

@@ -0,0 +1,19 @@
import aiopg
# Only a cursor can execute sql.
async def test_cursor():
# Create connection directly
conn = await aiopg.connect()
cur = await conn.cursor()
await cur.execute("sql") # $ MISSING: getSql="sql"
# Create connection via pool
async with aiopg.create_pool() as pool:
# Create Cursor via Connection
async with pool.acquire() as conn:
cur = await conn.cursor()
await cur.execute("sql") # $ MISSING: getSql="sql"
# Create Cursor directly
async with pool.cursor() as cur:
await cur.execute("sql") # $ MISSING: getSql="sql"