| Total Complexity | 2 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |