コード例 #1
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
 def test_getInstruments_NoAccount(self):
     gwy = BinanceGwy()
     gwy.establishSession()
     with self.assertRaises(InvalidAccountError) as cm:
         insts = gwy.getInstruments('NoSuchAccount')
     self.assertEqual(cm.exception.msg,
                      'Account - NoSuchAccount - does not exist')
コード例 #2
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
    def test_establishDestroySession(self):
        gwy = BinanceGwy()
        gwy.establishSession()
        self.assertFalse(gwy.session is None)

        gwy.destroySession()
        self.assertTrue(gwy.session is None)
コード例 #3
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
 def test_createOrder(self):
     gwy = BinanceGwy()
     gwy.establishSession()
     self.assertTrue(gwy.inTestMode())
     id_ = gwy.createOrder('accountId_example',
                           'TestInst1',
                           1.0,
                           'buy',
                           'limit',
                           0.008317,
                           durationType='gtc')
     self.assertEqual(id_, 'TEST_ID')
     self.assertFalse(id_ is None)
コード例 #4
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
 def test_getOrders(self):
     gwy = BinanceGwy()
     gwy.establishSession()
     ords = gwy.getOrders('accountId_example')
     self.assertEqual(len(ords), 0)
コード例 #5
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
 def test_getInstruments(self):
     gwy = BinanceGwy()
     gwy.establishSession()
     insts = gwy.getInstruments('accountId_example')
     self.assertTrue(len(insts) > 0)
コード例 #6
0
ファイル: test_binance_gateway.py プロジェクト: HogRoast/TVS
 def test_getAllInstruments(self):
     gwy = BinanceGwy()
     gwy.establishSession()
     insts = gwy.getAllInstruments()
     self.assertTrue(len(insts) > 0)