Python code cleanup

These changes should not change any functionality.

In code:

- Added async keyword to CryptoSystem::kind since it's actually implemented async
- Removed unused socket import in json_api

In tests:
- Removed unused imports
- Removed unnecessary return statements
- Removed unused variables
- Cleaned up some spacing to match PEP-8
- Changed many comparisons to match PEP-8
- Use ValueSubKey classes instead of integers to keep types in line
This commit is contained in:
DumontIO 2024-08-13 16:47:06 -04:00
parent 0c19414934
commit c92e07c88e
7 changed files with 87 additions and 95 deletions

View file

@ -3,7 +3,6 @@
import pytest
import veilid
from veilid.api import CryptoSystem
import gc
@pytest.mark.asyncio
@ -42,9 +41,10 @@ async def test_hash_and_verify_password(api_connection: veilid.VeilidAPI):
assert await cs.verify_password(b"abc123", phash)
# Password mismatch
phash2 = await cs.hash_password(b"abc1234", salt)
await cs.hash_password(b"abc1234", salt)
assert not await cs.verify_password(b"abc12345", phash)
@pytest.mark.asyncio
async def test_sign_and_verify_signature(api_connection: veilid.VeilidAPI):
cs = await api_connection.best_crypto_system()