Completed
Push — main ( 5e6d02...339f4c )
by
unknown
15s queued 12s
created

tests.test_tradehub_get_all_validators   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 49
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 35
dl 0
loc 49
rs 10
c 0
b 0
f 0
wmc 3
1
from tests import APITestCase, mainnet_client
2
3
4
class TestTradeHubGetAllValidators(APITestCase):
5
6
    def setUp(self) -> None:
7
        self._client = mainnet_client
8
9
    def test_get_all_validators_structure(self):
10
        """
11
        Check if response match expected dict structure.
12
        :return:
13
        """
14
        expect: dict = {
15
            "OperatorAddress": str,
16
            "ConsPubKey": str,
17
            "Jailed": bool,
18
            "Status": int,
19
            "Tokens": str,
20
            "DelegatorShares": str,
21
            "Description": {
22
                "moniker": str,
23
                "identity": str,
24
                "website": str,
25
                "security_contact": str,
26
                "details": str
27
            },
28
            "UnbondingHeight": int,
29
            "UnbondingCompletionTime": str,
30
            "Commission": {
31
                "commission_rates": {
32
                    "rate": str,
33
                    "max_rate": str,
34
                    "max_change_rate": str
35
                },
36
                "update_time": str
37
            },
38
            "MinSelfDelegation": str,
39
            "ConsAddress": str,
40
            "ConsAddressByte": str,
41
            "WalletAddress": str,
42
            "BondStatus": str
43
        }
44
45
        result: list = self._client.get_all_validators()
46
47
        for item in result:
48
            self.assertDictStructure(expect, item)
49