github.com/status-im/status-go@v1.1.0/integration-tests/tests/test_accounts.py (about)

     1  import random
     2  import pytest
     3  import jsonschema
     4  import json
     5  from conftest import option
     6  from test_cases import RpcTestCase
     7  
     8  
     9  @pytest.mark.accounts
    10  @pytest.mark.rpc
    11  class TestAccounts(RpcTestCase):
    12  
    13      @pytest.mark.parametrize(
    14          "method, params",
    15          [
    16              ("accounts_getKeypairs", []),
    17              ("accounts_hasPairedDevices", []),
    18              ("accounts_remainingAccountCapacity", [])
    19  
    20          ],
    21      )
    22      def test_(self, method, params):
    23          _id = str(random.randint(1, 8888))
    24  
    25          response = self.rpc_request(method, params, _id)
    26          self.verify_is_valid_json_rpc_response(response)
    27          with open(f"{option.base_dir}/schemas/{method}", "r") as schema:
    28              jsonschema.validate(instance=response.json(), schema=json.load(schema))