chore: update black, new formatting + pre-commit (#3885)
This commit is contained in:
@@ -6,25 +6,21 @@ from tests.helpers import DbTestModel
|
||||
@pytest.fixture(scope="session")
|
||||
async def fetch_page(db):
|
||||
await db.execute("DROP TABLE IF EXISTS test_db_fetch_page")
|
||||
await db.execute(
|
||||
"""
|
||||
await db.execute("""
|
||||
CREATE TABLE test_db_fetch_page (
|
||||
id TEXT PRIMARY KEY,
|
||||
value TEXT NOT NULL,
|
||||
name TEXT NOT NULL
|
||||
)
|
||||
"""
|
||||
)
|
||||
await db.execute(
|
||||
"""
|
||||
""")
|
||||
await db.execute("""
|
||||
INSERT INTO test_db_fetch_page (id, name, value) VALUES
|
||||
('1', 'Alice', 'foo'),
|
||||
('2', 'Bob', 'bar'),
|
||||
('3', 'Carol', 'bar'),
|
||||
('4', 'Dave', 'bar'),
|
||||
('5', 'Dave', 'foo')
|
||||
"""
|
||||
)
|
||||
""")
|
||||
yield
|
||||
await db.execute("DROP TABLE test_db_fetch_page")
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ def encrypt_content(priv_key, dest_pub_key, content):
|
||||
def decrypt_content(priv_key, source_pub_key, content):
|
||||
p = PublicKey(bytes.fromhex("02" + source_pub_key))
|
||||
shared = p.multiply(bytes.fromhex(priv_key)).format()[1:]
|
||||
(encrypted_content_b64, iv_b64) = content.split("?iv=")
|
||||
encrypted_content_b64, iv_b64 = content.split("?iv=")
|
||||
encrypted_content = base64.b64decode(encrypted_content_b64.encode("ascii"))
|
||||
iv = base64.b64decode(iv_b64.encode("ascii"))
|
||||
aes = AES.new(shared, AES.MODE_CBC, iv)
|
||||
|
||||
Reference in New Issue
Block a user