1 from nose.tools import *
2
3 from grassyknoll.concurrent.Message import *
4
6
8 mesg=Message("what is the meaning of life")
9 assert mesg.payload == "what is the meaning of life"
10 assert isinstance(mesg.id, (int, long))
11 assert mesg.reply_box is None
12 assert mesg.re_id is None
13
15 mesg=Message("what is the meaning of life")
16 mesg3=Message("life, universe, everything!", re_id=mesg.id)
17 assert mesg3.payload == "life, universe, everything!"
18 assert isinstance(mesg3.id, (int, long))
19 assert mesg3.reply_box is None
20 assert mesg3.re_id == mesg.id
21
23 assert_raises(TypeError, Message, payload=True, re_id="pants")
24
26 assert_raises(TypeError, Message, payload=True, reply_box="pants")
27