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

tests.test_tradehub_get_blocks   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 28
rs 10
c 0
b 0
f 0
wmc 3
1
from tests import APITestCase, mainnet_client
2
3
4
class TestTradeHubGetBlocks(APITestCase):
5
6
    def setUp(self) -> None:
7
        self._client = mainnet_client
8
9
    def test_get_blocks_structure(self):
10
        """
11
        Check if response match expected dict structure.
12
        :return:
13
        """
14
15
        expect: dict = {
16
            "block_height": str,
17
            "time": str,
18
            "count": str,
19
            "proposer_address": str
20
        }
21
22
        result: list = self._client.get_blocks()
23
24
        self.assertEqual(200, len(result), msg="Expected count(200) off blocks are not returned.")
25
26
        for block in result:
27
            self.assertDictStructure(expect, block)
28