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

tests.test_tradehub_get_account   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 35
rs 10
c 0
b 0
f 0
wmc 2
1
from tests import APITestCase, mainnet_client
2
3
4
class TestTradeHubGetAccount(APITestCase):
5
6
    def setUp(self) -> None:
7
        self._client = mainnet_client
8
9
    def test_get_account_structure(self):
10
        """
11
        Check if response match expected dict structure.
12
        :return:
13
        """
14
        expect: dict = {
15
            'height': str,
16
            'result': {
17
                'type': str,
18
                'value': {
19
                    'address': str,
20
                    'coins': [  # Because it is a list, all entries will be checked
21
                        {'denom': str, 'amount': str}
22
                    ],
23
                    'public_key': {
24
                        'type': str,
25
                        'value': str
26
                    },
27
                    'account_number': str,
28
                    'sequence': str
29
                }
30
            }
31
        }
32
33
        result = self._client.get_account("swth1qlue2pat9cxx2s5xqrv0ashs475n9va963h4hz")
34
        self.assertDictStructure(expect, result)
35