| Total Complexity | 2 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from tests import APITestCase, mainnet_client |
||
| 2 | |||
| 3 | |||
| 4 | class TestTradeHubGetTransaction(APITestCase): |
||
| 5 | |||
| 6 | def setUp(self) -> None: |
||
| 7 | self._client = mainnet_client |
||
| 8 | |||
| 9 | def test_get_transaction_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 | "msgs": [ |
||
| 21 | { |
||
| 22 | "msg_type": str, |
||
| 23 | "msg": str |
||
| 24 | } |
||
| 25 | ], |
||
| 26 | "code": str, |
||
| 27 | "gas_used": str, |
||
| 28 | "gas_limit": str, |
||
| 29 | "memo": str, |
||
| 30 | "height": str, |
||
| 31 | "block_time": str |
||
| 32 | } |
||
| 33 | |||
| 34 | result: dict = self._client.get_transaction("A93BEAC075562D4B6031262BDDE8B9A720346A54D8570A881E3671FEB6E6EFD4") |
||
| 35 | |||
| 36 | self.assertDictStructure(expect, result) |
||
| 37 |