| Total Complexity | 3 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from tests import APITestCase, mainnet_client, WALLET_DEVEL |
||
| 2 | from typing import Union |
||
| 3 | |||
| 4 | |||
| 5 | class TestTradeHubGetExternalTransfers(APITestCase): |
||
| 6 | |||
| 7 | def setUp(self) -> None: |
||
| 8 | self._client = mainnet_client |
||
| 9 | |||
| 10 | def test_get_external_transfers(self): |
||
| 11 | """ |
||
| 12 | Check if response match expected dict structure. |
||
| 13 | :return: |
||
| 14 | """ |
||
| 15 | # TODO need test wallet to be deterministic |
||
| 16 | expect: dict = { |
||
| 17 | "address": str, |
||
| 18 | "amount": str, |
||
| 19 | "block_height": int, |
||
| 20 | "blockchain": str, |
||
| 21 | "contract_hash": str, |
||
| 22 | "denom": str, |
||
| 23 | "fee_address": Union[str, None], |
||
| 24 | "fee_amount": str, |
||
| 25 | "id": str, |
||
| 26 | "status": str, |
||
| 27 | "symbol": str, |
||
| 28 | "timestamp": int, |
||
| 29 | "token_name": str, |
||
| 30 | "transaction_hash": str, |
||
| 31 | "transfer_type": str |
||
| 32 | } |
||
| 33 | |||
| 34 | result: list = self._client.get_external_transfers(WALLET_DEVEL) |
||
| 35 | |||
| 36 | # Can not check this atm, cause it can change need test wallet |
||
| 37 | # self.assertEqual(1, len(result), msg="Expected count(1) of external transfers are not returned.") |
||
| 38 | |||
| 39 | for transfer in result: |
||
| 40 | self.assertDictStructure(expect, transfer) |
||
| 41 |