Updated test suite
This commit is contained in:
parent
a246097b82
commit
c9a1614856
|
@ -6,17 +6,18 @@ def basicTest():
|
||||||
d=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
d=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
d.connect(("127.0.0.1",2223))
|
d.connect(("127.0.0.1",2223))
|
||||||
|
|
||||||
# First do it and authenticate
|
while True:
|
||||||
bys=json.dumps({"header":{"authentication":{"username":"tbk", "password":"passwd"}, "scope":"client"},"payload":{"data":"ABBA","type":"type1"}})
|
# First do it and authenticate
|
||||||
print(len(bys), bys)
|
bys=json.dumps({"header":{"authentication":{"username":"tbk", "password":"passwd"}, "scope":"client"},"payload":{"data":"ABBA","type":"type1"}})
|
||||||
d.send(len(bys).to_bytes(4, "little"))
|
print(len(bys), bys)
|
||||||
d.send(bys.encode())
|
d.send(len(bys).to_bytes(4, "little"))
|
||||||
|
d.send(bys.encode())
|
||||||
|
|
||||||
# Now we can do it again (without authentication)
|
# Now we can do it again (without authentication)
|
||||||
bys=json.dumps({"header":{},"payload":{"data":"POES","type":"type1"}})
|
bys=json.dumps({"header":{},"payload":{"data":"POES","type":"type1"}})
|
||||||
print(len(bys), bys)
|
print(len(bys), bys)
|
||||||
d.send(len(bys).to_bytes(4, "little"))
|
d.send(len(bys).to_bytes(4, "little"))
|
||||||
d.send(bys.encode())
|
d.send(bys.encode())
|
||||||
|
|
||||||
while True: pass
|
while True: pass
|
||||||
d.close()
|
d.close()
|
||||||
|
|
Loading…
Reference in New Issue