mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
start ot add test
This commit is contained in:
parent
e961df49c3
commit
5ca67e7ec4
32
salt/transport/road/raet/test/test_stacking.py
Normal file
32
salt/transport/road/raet/test/test_stacking.py
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
'''
|
||||||
|
Tests to try out stacking. Potentially ephemeral
|
||||||
|
|
||||||
|
'''
|
||||||
|
|
||||||
|
from salt.transport.road.raet import stacking, packeting
|
||||||
|
from ioflo.base.odicting import odict
|
||||||
|
|
||||||
|
def test():
|
||||||
|
data = odict(hk=1, bk=1, bf=1, cf=1)
|
||||||
|
body=odict(msg='Hello Raet World', extra='what is this')
|
||||||
|
packet1 = packeting.Packet(data=data, body=body)
|
||||||
|
print packet1.body.data
|
||||||
|
print packet1.pack()
|
||||||
|
|
||||||
|
|
||||||
|
packet2 = packeting.Packet()
|
||||||
|
packet2.parse(packet1.packed)
|
||||||
|
print packet2.body.data
|
||||||
|
|
||||||
|
packet3 = packeting.Packet(raw=packet1.packed)
|
||||||
|
print packet3.body.data
|
||||||
|
|
||||||
|
packet1.parse(packet1.packed)
|
||||||
|
print packet1.body.data
|
||||||
|
print packet1.pack()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
test()
|
Loading…
Reference in New Issue
Block a user