Passed
Pull Request — main (#42)
by Switcheolytics
55s
created

tests.test_tradehub_get_delegation_rewards   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 19
dl 0
loc 41
rs 10
c 0
b 0
f 0
wmc 2
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