start ot add test

This commit is contained in:
Samuel M Smith 2014-02-08 19:05:53 -07:00
parent e961df49c3
commit 5ca67e7ec4

View 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()