Total Complexity | 2 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | from tests import APITestCase, mainnet_client |
||
2 | |||
3 | |||
4 | class TestTradeHubGetMarket(APITestCase): |
||
5 | |||
6 | def setUp(self) -> None: |
||
7 | self._client = mainnet_client |
||
8 | |||
9 | def test_get_candlesticks_structure(self): |
||
10 | """ |
||
11 | Check if response match expected dict structure. |
||
12 | :return: |
||
13 | """ |
||
14 | |||
15 | expect: dict = { |
||
16 | "type": str, |
||
17 | "name": str, |
||
18 | "display_name": str, |
||
19 | "description": str, |
||
20 | "market_type": str, |
||
21 | "base": str, |
||
22 | "base_name": str, |
||
23 | "base_precision": int, |
||
24 | "quote": str, |
||
25 | "quote_name": str, |
||
26 | "quote_precision": int, |
||
27 | "lot_size": str, |
||
28 | "tick_size": str, |
||
29 | "min_quantity": str, |
||
30 | "maker_fee": str, |
||
31 | "taker_fee": str, |
||
32 | "risk_step_size": str, |
||
33 | "initial_margin_base": str, |
||
34 | "initial_margin_step": str, |
||
35 | "maintenance_margin_ratio": str, |
||
36 | "max_liquidation_order_ticket": str, |
||
37 | "max_liquidation_order_duration": int, |
||
38 | "impact_size": str, |
||
39 | "mark_price_band": int, |
||
40 | "last_price_protected_band": int, |
||
41 | "index_oracle_id": str, |
||
42 | "expiry_time": str, |
||
43 | "is_active": bool, |
||
44 | "is_settled": bool, |
||
45 | "closed_block_height": int, |
||
46 | "created_block_height": int |
||
47 | } |
||
48 | |||
49 | result: dict = self._client.get_market("swth_eth1") |
||
50 | |||
51 | self.assertDictStructure(expect, result) |
||
52 |