Passed
Pull Request — main (#43)
by Switcheolytics
01:26
created

tests.test_tradehub_get_order   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 34
dl 0
loc 46
rs 10
c 0
b 0
f 0
wmc 2
1
from tests import APITestCase, mainnet_client
2
3
4
class TestTradeHubGetOrder(APITestCase):
5
6
    def setUp(self) -> None:
7
        self._client = mainnet_client
8
9
    def test_get_get_order_structure(self):
10
        """
11
        Check if response match expected dict structure.
12
        :return:
13
        """
14
15
        expect: dict = {
16
            "order_id": str,
17
            "block_height": int,
18
            "triggered_block_height": int,
19
            "address": str,
20
            "market": str,
21
            "side": str,
22
            "price": str,
23
            "quantity": str,
24
            "available": str,
25
            "filled": str,
26
            "order_status": str,
27
            "order_type": str,
28
            "initiator": str,
29
            "time_in_force": str,
30
            "stop_price": str,
31
            "trigger_type": str,
32
            "allocated_margin_denom": str,
33
            "allocated_margin_amount": str,
34
            "is_liquidation": bool,
35
            "is_post_only": bool,
36
            "is_reduce_only": bool,
37
            "type": str,
38
            "block_created_at": str,
39
            "username": str,
40
            "id": str
41
        }
42
43
        result: dict = self._client.get_order("4F54D2AE0D793F833806109B4278335BF3D392D4096B682B9A27AF9F8A8BCA58")
44
45
        self.assertDictStructure(expect, result)
46