Exemple #1
0
 def test_createOrder_NotEstablished(self):
     gwy = BinanceGwy()
     self.assertTrue(gwy.inTestMode())
     with self.assertRaises(InvalidSessionError) as cm:
         id_ = gwy.createOrder('accountId_example',
                               'TestInst1',
                               1.0,
                               'buy',
                               'limit',
                               0.008317,
                               durationType='gtc')
     self.assertEqual(cm.exception.msg, 'Session not established')
Exemple #2
0
 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)