mirror of
https://github.com/github/codeql.git
synced 2026-05-01 19:55:15 +02:00
Python: Add tests for aiopg
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
import python
|
||||
import experimental.meta.ConceptsTest
|
||||
19
python/ql/test/library-tests/frameworks/aiopg/test.py
Normal file
19
python/ql/test/library-tests/frameworks/aiopg/test.py
Normal 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"
|
||||
Reference in New Issue
Block a user