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')
def test_getInstruments_NotEstablished(self): gwy = BinanceGwy() with self.assertRaises(InvalidSessionError) as cm: insts = gwy.getInstruments('accountId_example') self.assertEqual(cm.exception.msg, 'Session not established')
def test_getInstruments(self): gwy = BinanceGwy() gwy.establishSession() insts = gwy.getInstruments('accountId_example') self.assertTrue(len(insts) > 0)