| @@ 45-71 (lines=27) @@ | ||
| 42 | self.checkResponse(result) |
|
| 43 | self.assertDictStructure(expect, result) |
|
| 44 | ||
| 45 | def test_limit_sell(self): |
|
| 46 | expect: dict = { |
|
| 47 | 'height': str, |
|
| 48 | 'txhash': str, |
|
| 49 | 'raw_log': str, |
|
| 50 | 'logs': [{ |
|
| 51 | 'msg_index': int, |
|
| 52 | 'log': str, |
|
| 53 | 'events': [{ |
|
| 54 | 'type': str, |
|
| 55 | 'attributes': [{ |
|
| 56 | 'key': str, |
|
| 57 | 'value': str |
|
| 58 | }, { |
|
| 59 | 'key': str, |
|
| 60 | 'value': str |
|
| 61 | }] |
|
| 62 | }] |
|
| 63 | }], |
|
| 64 | 'gas_wanted': str, |
|
| 65 | 'gas_used': str |
|
| 66 | } |
|
| 67 | ||
| 68 | time.sleep(2) |
|
| 69 | result: dict = self.demex_client.limit_sell(pair='swth_eth', quantity='400', price='0.0000227') |
|
| 70 | self.checkResponse(result) |
|
| 71 | self.assertDictStructure(expect, result) |
|
| 72 | ||
| 73 | def test_market_buy(self): |
|
| 74 | expect: dict = { |
|
| @@ 17-43 (lines=27) @@ | ||
| 14 | if 'code' in response: |
|
| 15 | self.skipTest(f"Skip test because of unknown error: {response['code']}") |
|
| 16 | ||
| 17 | def test_limit_buy(self): |
|
| 18 | expect: dict = { |
|
| 19 | 'height': str, |
|
| 20 | 'txhash': str, |
|
| 21 | 'raw_log': str, |
|
| 22 | 'logs': [{ |
|
| 23 | 'msg_index': int, |
|
| 24 | 'log': str, |
|
| 25 | 'events': [{ |
|
| 26 | 'type': str, |
|
| 27 | 'attributes': [{ |
|
| 28 | 'key': str, |
|
| 29 | 'value': str |
|
| 30 | }, { |
|
| 31 | 'key': str, |
|
| 32 | 'value': str |
|
| 33 | }] |
|
| 34 | }] |
|
| 35 | }], |
|
| 36 | 'gas_wanted': str, |
|
| 37 | 'gas_used': str |
|
| 38 | } |
|
| 39 | ||
| 40 | time.sleep(2) |
|
| 41 | result: dict = self.demex_client.limit_buy(pair='swth_eth', quantity='400', price='0.0000091') |
|
| 42 | self.checkResponse(result) |
|
| 43 | self.assertDictStructure(expect, result) |
|
| 44 | ||
| 45 | def test_limit_sell(self): |
|
| 46 | expect: dict = { |
|