| Total Complexity | 3 |
| Total Lines | 28 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 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 |