[Mod] restful包改名为network
[Mod] RestfulClient改名为HttpClient
This commit is contained in:
parent
8dcc785fd3
commit
7d65170e53
@ -5,14 +5,14 @@ import traceback
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from Promise import Promise
|
from Promise import Promise
|
||||||
from vnpy.restful.RestfulClient import RestfulClient, requestsSessionProvider
|
from vnpy.network.HttpClient import HttpClient, requestsSessionProvider
|
||||||
|
|
||||||
|
|
||||||
class TestRestfulClient(RestfulClient):
|
class TestHttpClient(HttpClient):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
urlBase = 'https://httpbin.org'
|
urlBase = 'https://httpbin.org'
|
||||||
super(TestRestfulClient, self).__init__()
|
super(TestHttpClient, self).__init__()
|
||||||
self.init(urlBase)
|
self.init(urlBase)
|
||||||
|
|
||||||
self.p = Promise()
|
self.p = Promise()
|
||||||
@ -29,7 +29,7 @@ class TestRestfulClient(RestfulClient):
|
|||||||
class RestfulClientTest(unittest.TestCase):
|
class RestfulClientTest(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.c = TestRestfulClient()
|
self.c = TestHttpClient()
|
||||||
self.c.start()
|
self.c.start()
|
||||||
|
|
||||||
def tearDown(self):
|
def tearDown(self):
|
||||||
|
@ -3,7 +3,7 @@ import json
|
|||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from Promise import Promise
|
from Promise import Promise
|
||||||
from vnpy.restful.WebSocketClient import WebsocketClient
|
from vnpy.network.WebSocketClient import WebsocketClient
|
||||||
|
|
||||||
|
|
||||||
class TestWebsocketClient(WebsocketClient):
|
class TestWebsocketClient(WebsocketClient):
|
||||||
|
@ -51,7 +51,11 @@ class Request(object):
|
|||||||
|
|
||||||
|
|
||||||
########################################################################
|
########################################################################
|
||||||
class RestfulClient(object):
|
class HttpClient(object):
|
||||||
|
"""
|
||||||
|
HTTP 客户端。目前是为了对接各种RESTFulAPI而设计的。
|
||||||
|
一般情况下应该
|
||||||
|
"""
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
def __init__(self):
|
def __init__(self):
|
Loading…
Reference in New Issue
Block a user