Total Complexity | 2 |
Total Lines | 61 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from tests import APITestCase, mainnet_client |
||
2 | |||
3 | |||
4 | class TestTradeHubGetStatus(APITestCase): |
||
5 | |||
6 | def setUp(self) -> None: |
||
7 | self._client = mainnet_client |
||
8 | |||
9 | def test_get_status_structure(self): |
||
10 | """ |
||
11 | Check if response match expected dict structure. |
||
12 | :return: |
||
13 | """ |
||
14 | |||
15 | expect: dict = { |
||
16 | "jsonrpc": str, |
||
17 | "id": int, |
||
18 | "result": { |
||
19 | "node_info": { |
||
20 | "protocol_version": { |
||
21 | "p2p": str, |
||
22 | "block": str, |
||
23 | "app": str, |
||
24 | }, |
||
25 | "id": str, |
||
26 | "listen_addr": str, |
||
27 | "network": str, |
||
28 | "version": str, |
||
29 | "channels": str, |
||
30 | "moniker": str, |
||
31 | "other": { |
||
32 | "tx_index": str, |
||
33 | "rpc_address": str, |
||
34 | } |
||
35 | }, |
||
36 | "sync_info": { |
||
37 | "latest_block_hash": str, |
||
38 | "latest_app_hash": str, |
||
39 | "latest_block_height": str, |
||
40 | "latest_block_time": str, |
||
41 | "earliest_block_hash": str, |
||
42 | "earliest_app_hash": str, |
||
43 | "earliest_block_height": str, |
||
44 | "earliest_block_time": str, |
||
45 | "catching_up": bool |
||
46 | }, |
||
47 | "validator_info": { |
||
48 | "address": str, |
||
49 | "pub_key": { |
||
50 | "type": str, |
||
51 | "value": str, |
||
52 | }, |
||
53 | "voting_power": str, |
||
54 | } |
||
55 | } |
||
56 | } |
||
57 | |||
58 | result: dict = self._client.get_status() |
||
59 | |||
60 | self.assertDictStructure(expect, result) |
||
61 |