<filename>tests/test-getAccountInfo.py<gh_stars>1-10
#!/usr/bin/python

import pandas as pd
import sys
sys.path.append('../')
from Binance import Binance
import logging.config
import logging.handlers
import logging
import os


# this logging configuration is sketchy
binance = logging.getLogger(__name__)
logging.config.fileConfig('logging.ini')

# create Binance object
bn = Binance()

# set keys
bn.setSecretKey('<KEY>')
bn.setAPIKey('<KEY>')


# getAccountInfo
print "---------------- getAccountInfo --------------"
print "################################# POSITIVE TESTS (returns 1 or r) ###################"
queryParams = {}
print "****test empty inputs, timestamp autogenerated"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':1507770491000}
print "****test timestamp supplied"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'recvWindow':123435234}
print "****test timestamp autogenerated, optional params"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':1507770491000,'recvWindow':123435234}
print "****test valid timestamp supplied, optional params"
test = bn.getAccountInfo(queryParams)
print

print "################################# NEGATIVE TESTS (returns 0) ###################"
print
queryParams = {'timestamp':12.5}
print "****test valid mandatory inputs present with invalid type"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'recvWindow':'123456778','timestamp':150774295}
print "****test invalid user proved timestamp, plus some valid optional"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':'abcdefghijklm'}
print "****test invalid user proved timestamp type but length ok, plus some optional"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkbite':'abcdefghijklm'}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkFLOAT':10.11}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkINTEGER':10}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)

<filename>tests/test-getAccountInfo.py<gh_stars>1-10
#!/usr/bin/python

import pandas as pd
import sys
sys.path.append('../')
from Binance import Binance
import logging.config
import logging.handlers
import logging
import os


# this logging configuration is sketchy
binance = logging.getLogger(__name__)
logging.config.fileConfig('logging.ini')

# create Binance object
bn = Binance()

# set keys
bn.setSecretKey('<KEY>')
bn.setAPIKey('<KEY>')


# getAccountInfo
print "---------------- getAccountInfo --------------"
print "################################# POSITIVE TESTS (returns 1 or r) ###################"
queryParams = {}
print "****test empty inputs, timestamp autogenerated"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':1507770491000}
print "****test timestamp supplied"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'recvWindow':123435234}
print "****test timestamp autogenerated, optional params"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':1507770491000,'recvWindow':123435234}
print "****test valid timestamp supplied, optional params"
test = bn.getAccountInfo(queryParams)
print

print "################################# NEGATIVE TESTS (returns 0) ###################"
print
queryParams = {'timestamp':12.5}
print "****test valid mandatory inputs present with invalid type"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'recvWindow':'123456778','timestamp':150774295}
print "****test invalid user proved timestamp, plus some valid optional"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'timestamp':'abcdefghijklm'}
print "****test invalid user proved timestamp type but length ok, plus some optional"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkbite':'abcdefghijklm'}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkFLOAT':10.11}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)
print
queryParams = {'sharkINTEGER':10}
print "****test random input invalid value"
test = bn.getAccountInfo(queryParams)

#!/usr/bin/python # this logging configuration is sketchy # create Binance object # set keys # getAccountInfo ################################ POSITIVE TESTS (returns 1 or r) ###################" ################################ NEGATIVE TESTS (returns 0) ###################"