| Total Complexity | 3 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from tests import APITestCase, mainnet_client |
||
| 2 | |||
| 3 | |||
| 4 | class TestTradeHubGetTransactions(APITestCase): |
||
| 5 | |||
| 6 | def setUp(self) -> None: |
||
| 7 | self._client = mainnet_client |
||
| 8 | |||
| 9 | def test_get_transactions_structure(self): |
||
| 10 | """ |
||
| 11 | Check if response match expected dict structure. |
||
| 12 | :return: |
||
| 13 | """ |
||
| 14 | |||
| 15 | expect: dict = { |
||
| 16 | "id": str, |
||
| 17 | "hash": str, |
||
| 18 | "address": str, |
||
| 19 | "username": str, |
||
| 20 | "msg_type": str, |
||
| 21 | "msg": str, |
||
| 22 | "code": str, |
||
| 23 | "gas_used": str, |
||
| 24 | "gas_limit": str, |
||
| 25 | "memo": str, |
||
| 26 | "height": str, |
||
| 27 | "block_time": str |
||
| 28 | } |
||
| 29 | |||
| 30 | result: list = self._client.get_transactions() |
||
| 31 | |||
| 32 | self.assertEqual(200, len(result), msg="Expected count(200) of transactions are not returned.") |
||
| 33 | |||
| 34 | for transaction in result: |
||
| 35 | self.assertDictStructure(expect, transaction) |
||
| 36 |