From 7d65170e53ce7193d9568201c5b1bf6a16d1a287 Mon Sep 17 00:00:00 2001 From: nanoric Date: Sun, 7 Oct 2018 22:31:08 -0400 Subject: [PATCH] =?UTF-8?q?[Mod]=20restful=E5=8C=85=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E4=B8=BAnetwork=20[Mod]=20RestfulClient=E6=94=B9=E5=90=8D?= =?UTF-8?q?=E4=B8=BAHttpClient?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/restful/RestfulClientTest.py | 8 ++++---- tests/restful/WebSocketClientTest.py | 2 +- vnpy/{restful/RestfulClient.py => network/HttpClient.py} | 6 +++++- vnpy/{restful => network}/WebSocketClient.py | 0 vnpy/{restful => network}/__init__.py | 0 5 files changed, 10 insertions(+), 6 deletions(-) rename vnpy/{restful/RestfulClient.py => network/HttpClient.py} (97%) rename vnpy/{restful => network}/WebSocketClient.py (100%) rename vnpy/{restful => network}/__init__.py (100%) diff --git a/tests/restful/RestfulClientTest.py b/tests/restful/RestfulClientTest.py index 06aef8c6..4a35072e 100644 --- a/tests/restful/RestfulClientTest.py +++ b/tests/restful/RestfulClientTest.py @@ -5,14 +5,14 @@ import traceback import unittest 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): urlBase = 'https://httpbin.org' - super(TestRestfulClient, self).__init__() + super(TestHttpClient, self).__init__() self.init(urlBase) self.p = Promise() @@ -29,7 +29,7 @@ class TestRestfulClient(RestfulClient): class RestfulClientTest(unittest.TestCase): def setUp(self): - self.c = TestRestfulClient() + self.c = TestHttpClient() self.c.start() def tearDown(self): diff --git a/tests/restful/WebSocketClientTest.py b/tests/restful/WebSocketClientTest.py index 79b47510..4337a3c0 100644 --- a/tests/restful/WebSocketClientTest.py +++ b/tests/restful/WebSocketClientTest.py @@ -3,7 +3,7 @@ import json import unittest from Promise import Promise -from vnpy.restful.WebSocketClient import WebsocketClient +from vnpy.network.WebSocketClient import WebsocketClient class TestWebsocketClient(WebsocketClient): diff --git a/vnpy/restful/RestfulClient.py b/vnpy/network/HttpClient.py similarity index 97% rename from vnpy/restful/RestfulClient.py rename to vnpy/network/HttpClient.py index 5a3cc3aa..660c5f24 100644 --- a/vnpy/restful/RestfulClient.py +++ b/vnpy/network/HttpClient.py @@ -51,7 +51,11 @@ class Request(object): ######################################################################## -class RestfulClient(object): +class HttpClient(object): + """ + HTTP 客户端。目前是为了对接各种RESTFulAPI而设计的。 + 一般情况下应该 + """ #---------------------------------------------------------------------- def __init__(self): diff --git a/vnpy/restful/WebSocketClient.py b/vnpy/network/WebSocketClient.py similarity index 100% rename from vnpy/restful/WebSocketClient.py rename to vnpy/network/WebSocketClient.py diff --git a/vnpy/restful/__init__.py b/vnpy/network/__init__.py similarity index 100% rename from vnpy/restful/__init__.py rename to vnpy/network/__init__.py