2019-03-27 08:17:33 +00:00
|
|
|
# flake8: noqa
|
2019-04-15 17:40:03 +00:00
|
|
|
import platform
|
2019-06-25 08:59:56 +00:00
|
|
|
import unittest
|
2019-03-27 08:17:33 +00:00
|
|
|
|
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
# noinspection PyUnresolvedReferences,PyMethodMayBeStatic
|
|
|
|
class CoreImportTest(unittest.TestCase):
|
2019-03-27 08:17:33 +00:00
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
def test_import_event_engine(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.event import EventEngine
|
|
|
|
|
2019-04-14 03:02:30 +00:00
|
|
|
def test_import_main_engine(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.trader.engine import MainEngine
|
2019-04-14 03:02:30 +00:00
|
|
|
|
|
|
|
def test_import_ui(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.trader.ui import MainWindow, create_qapp
|
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
|
|
|
|
# noinspection PyUnresolvedReferences,PyMethodMayBeStatic
|
|
|
|
class GatewayImportTest(unittest.TestCase):
|
|
|
|
|
|
|
|
def test_import_binance(self):
|
|
|
|
from vnpy.gateway.binance import BinanceGateway
|
|
|
|
|
|
|
|
def test_import_bitfinex(self):
|
|
|
|
from vnpy.gateway.bitfinex import BitfinexGateway
|
|
|
|
|
|
|
|
def test_import_bitmex(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.gateway.bitmex import BitmexGateway
|
2019-04-14 03:02:30 +00:00
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
|
|
|
def test_import_ctp(self):
|
|
|
|
from vnpy.gateway.ctp import CtpGateway
|
|
|
|
|
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
|
|
|
def test_import_ctptest(self):
|
|
|
|
from vnpy.gateway.ctptest import CtptestGateway
|
|
|
|
|
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
|
|
|
@unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux")
|
|
|
|
def test_import_femas(self):
|
|
|
|
from vnpy.gateway.femas import FemasGateway
|
|
|
|
|
|
|
|
def test_import_futu(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.gateway.futu import FutuGateway
|
2019-04-14 03:02:30 +00:00
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
def test_import_hbdm(self):
|
|
|
|
from vnpy.gateway.hbdm import HbdmGateway
|
|
|
|
|
|
|
|
def test_import_huobi(self):
|
|
|
|
from vnpy.gateway.huobi import HuobiGateway
|
|
|
|
|
|
|
|
def test_import_ib(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.gateway.ib import IbGateway
|
2019-04-14 03:02:30 +00:00
|
|
|
|
2019-04-15 17:40:03 +00:00
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
2019-06-25 08:59:56 +00:00
|
|
|
def test_import_oes(self):
|
|
|
|
from vnpy.gateway.oes import OesGateway
|
|
|
|
|
|
|
|
def test_import_okex(self):
|
|
|
|
from vnpy.gateway.okex import OkexGateway
|
|
|
|
|
|
|
|
def test_import_okexf(self):
|
|
|
|
from vnpy.gateway.okexf import OkexfGateway
|
|
|
|
|
|
|
|
def test_import_onetoken(self):
|
|
|
|
from vnpy.gateway.onetoken import OnetokenGateway
|
2019-04-14 03:02:30 +00:00
|
|
|
|
2019-06-25 08:59:56 +00:00
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
|
|
|
@unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux")
|
|
|
|
def test_import_tap(self):
|
|
|
|
from vnpy.gateway.tap import TapGateway
|
|
|
|
|
|
|
|
def test_import_tiger(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.gateway.tiger import TigerGateway
|
2019-04-14 03:02:30 +00:00
|
|
|
|
2019-04-15 17:40:03 +00:00
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
2019-06-25 08:59:56 +00:00
|
|
|
def test_import_tora(self):
|
|
|
|
from vnpy.gateway.tora import ToraGateway
|
|
|
|
|
2019-07-05 04:40:06 +00:00
|
|
|
@unittest.skipIf(platform.system() == "Linux", "Not supported yet under Linux")
|
|
|
|
@unittest.skipIf(platform.system() == "Darwin", "Not supported yet under osx")
|
2019-06-25 08:59:56 +00:00
|
|
|
def test_import_xtp(self):
|
|
|
|
from vnpy.gateway.xtp import XtpGateway
|
|
|
|
|
|
|
|
|
|
|
|
# noinspection PyUnresolvedReferences,PyMethodMayBeStatic
|
|
|
|
class AppImportTest(unittest.TestCase):
|
2019-03-27 08:17:33 +00:00
|
|
|
|
2019-04-14 03:02:30 +00:00
|
|
|
def test_import_cta_strategy_app(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.app.cta_strategy import CtaStrategyApp
|
2019-04-14 03:02:30 +00:00
|
|
|
|
|
|
|
def test_import_csv_loader_app(self):
|
2019-03-27 08:17:33 +00:00
|
|
|
from vnpy.app.csv_loader import CsvLoaderApp
|
|
|
|
|
|
|
|
|
|
|
|
if __name__ == '__main__':
|
|
|
|
unittest.main()
|