update test
This commit is contained in:
parent
9e6dfacaff
commit
a0c0e817ad
@ -2,4 +2,4 @@ language: python
|
|||||||
python:
|
python:
|
||||||
- "2.7"
|
- "2.7"
|
||||||
# command to run tests
|
# command to run tests
|
||||||
script: notest
|
script: python test.py
|
||||||
|
12
test.py
12
test.py
@ -5,10 +5,11 @@ sys.path.append("zk")
|
|||||||
import zk
|
import zk
|
||||||
from zk import const
|
from zk import const
|
||||||
|
|
||||||
|
conn = False
|
||||||
zk = zk.ZK('192.168.1.201', port=4370, timeout=5)
|
zk = zk.ZK('192.168.1.201', port=4370, timeout=5)
|
||||||
print 'Connecting to device ...'
|
try:
|
||||||
conn = zk.connect()
|
print 'Connecting to device ...'
|
||||||
if conn:
|
conn = zk.connect()
|
||||||
print 'Disabling device ...'
|
print 'Disabling device ...'
|
||||||
zk.disable_device()
|
zk.disable_device()
|
||||||
print 'Firmware Version: : {}'.format(zk.get_firmware_version())
|
print 'Firmware Version: : {}'.format(zk.get_firmware_version())
|
||||||
@ -43,3 +44,8 @@ if conn:
|
|||||||
print 'Disconnecting to device ...'
|
print 'Disconnecting to device ...'
|
||||||
zk.disconnect()
|
zk.disconnect()
|
||||||
|
|
||||||
|
except Exception, e:
|
||||||
|
print "Process terminate : {}".format(e)
|
||||||
|
finally:
|
||||||
|
if conn:
|
||||||
|
zk.disconnect()
|
||||||
|
Loading…
Reference in New Issue
Block a user