Skip to content

Commit cb8f1b4

Browse files
committed
Python: Add tests for aiopg
1 parent 330c2c4 commit cb8f1b4

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

python/ql/test/library-tests/frameworks/aiopg/ConceptsTest.expected

Whitespace-only changes.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import python
2+
import experimental.meta.ConceptsTest
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import aiopg
2+
3+
# Only a cursor can execute sql.
4+
async def test_cursor():
5+
# Create connection directly
6+
conn = await aiopg.connect()
7+
cur = await conn.cursor()
8+
await cur.execute("sql") # $ MISSING: getSql="sql"
9+
10+
# Create connection via pool
11+
async with aiopg.create_pool() as pool:
12+
# Create Cursor via Connection
13+
async with pool.acquire() as conn:
14+
cur = await conn.cursor()
15+
await cur.execute("sql") # $ MISSING: getSql="sql"
16+
17+
# Create Cursor directly
18+
async with pool.cursor() as cur:
19+
await cur.execute("sql") # $ MISSING: getSql="sql"

0 commit comments

Comments
 (0)