| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from tests import APITestCase, mainnet_client |
||
| 2 | |||
| 3 | |||
| 4 | class TestTradeHubGetTokens(APITestCase): |
||
| 5 | |||
| 6 | def setUp(self) -> None: |
||
| 7 | self._client = mainnet_client |
||
| 8 | |||
| 9 | def test_get_tokens_structure(self): |
||
| 10 | """ |
||
| 11 | Check if response match expected dict structure. |
||
| 12 | :return: |
||
| 13 | """ |
||
| 14 | |||
| 15 | expect: dict = { |
||
| 16 | "name": str, |
||
| 17 | "symbol": str, |
||
| 18 | "denom": str, |
||
| 19 | "decimals": int, |
||
| 20 | "blockchain": str, |
||
| 21 | "chain_id": int, |
||
| 22 | "asset_id": str, |
||
| 23 | "is_active": bool, |
||
| 24 | "is_collateral": bool, |
||
| 25 | "lock_proxy_hash": str, |
||
| 26 | "delegated_supply": str, |
||
| 27 | "originator": str |
||
| 28 | } |
||
| 29 | |||
| 30 | result: list = self._client.get_tokens() |
||
| 31 | |||
| 32 | for token in result: |
||
| 33 | self.assertDictStructure(expect, token) |
||
| 34 |