示例#1
0
    def test_buy(self, access_token, secret_key):
        client = Client(access_token, secret_key)
        order = client.buy(8000000, 0.01)

        self.assertEqual(order.result, "success")
        self.assertEqual(order.error_code, 0)
        self.assertIsInstance(order.order_id, str)
示例#2
0
    def test_buy_with_mock(self, mock_request):
        _ = mock_request

        client = Client("access_token", "secret_key")
        order = client.buy(100000, 0.001)

        self.assertEqual(order.result, "success")
        self.assertEqual(order.error_code, 0)
        self.assertIsInstance(order.order_id, str)