| Total Complexity | 2 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | from tests import APITestCase, mainnet_client, WALLET_VALIDATOR |
||
| 2 | |||
| 3 | |||
| 4 | class TestTradeHubGetDelegationRewards(APITestCase): |
||
| 5 | |||
| 6 | def setUp(self) -> None: |
||
| 7 | self._client = mainnet_client |
||
| 8 | |||
| 9 | def test_get_delegation_rewards_structure(self): |
||
| 10 | """ |
||
| 11 | Check if response match expected dict structure. |
||
| 12 | :return: |
||
| 13 | """ |
||
| 14 | |||
| 15 | expect: dict = { |
||
| 16 | "height": str, |
||
| 17 | "result": { |
||
| 18 | "rewards": [ |
||
| 19 | { |
||
| 20 | "validator_address": str, |
||
| 21 | "reward": [ |
||
| 22 | { |
||
| 23 | "denom": str, |
||
| 24 | "amount": str |
||
| 25 | } |
||
| 26 | ] |
||
| 27 | } |
||
| 28 | ], |
||
| 29 | "total": [ |
||
| 30 | { |
||
| 31 | "denom": str, |
||
| 32 | "amount": str |
||
| 33 | }, |
||
| 34 | ] |
||
| 35 | } |
||
| 36 | } |
||
| 37 | |||
| 38 | result: dict = self._client.get_delegation_rewards(WALLET_VALIDATOR) |
||
| 39 | |||
| 40 | self.assertDictStructure(expect, result) |
||
| 41 |