55"""
66
77import logging
8- import pytest
98import secrets
109
10+ import pytest
11+
1112from convex_api .api import API
1213from convex_api .key_pair import KeyPair
1314from tests .types import KeyPairInfo
3334
3435TEST_ACCOUNT_NAME = 'test.convex-api'
3536
37+
3638@pytest .fixture (scope = 'module' )
3739def test_key_pair_info () -> KeyPairInfo :
3840 return {
39- 'private_hex' : PRIVATE_TEST_KEY ,
41+ 'private_hex' : PRIVATE_TEST_KEY ,
4042 'private_bytes' : KeyPair .to_bytes (PRIVATE_TEST_KEY ),
4143 'private_text' : PRIVATE_TEST_KEY_TEXT ,
4244 'private_password' : PRIVATE_TEST_KEY_PASSWORD ,
4345 'private_mnemonic' : PRIVATE_KEY_MNEMONIC ,
4446 'public_key' : PUBLIC_KEY
4547 }
4648
49+
4750@pytest .fixture (scope = 'module' )
4851def test_key_pair (test_key_pair_info : KeyPairInfo ):
4952 key_pair = KeyPair .import_from_bytes (test_key_pair_info ['private_bytes' ])
5053 return key_pair
5154
55+
5256@pytest .fixture (scope = 'module' )
5357def test_account (convex : API , test_key_pair : KeyPair ):
5458 test_account_name = f'{ TEST_ACCOUNT_NAME } .{ secrets .token_hex (8 )} '
@@ -57,15 +61,18 @@ def test_account(convex: API, test_key_pair: KeyPair):
5761 convex .topup_account (account )
5862 return account
5963
64+
6065@pytest .fixture (scope = 'module' )
6166def convex_url ():
6267 return CONVEX_URL
6368
69+
6470@pytest .fixture (scope = 'module' )
6571def convex (convex_url : str ):
6672 api = API (convex_url )
6773 return api
6874
75+
6976@pytest .fixture (scope = 'module' )
7077def other_account (convex : API ):
7178 key_pair = KeyPair ()
0 commit comments