示例#1
0
 def test_marshall_string_space(self):
     self.assertEqual(b"5:bla l ", marshall("bla l"))
示例#2
0
 def send_msg(self, data):
     marshalled_data = marshall(data)
     # self.mutter("OUT: %r" % marshalled_data)
     self.send_fn(marshalled_data)
示例#3
0
 def test_marshall_string(self):
     self.assertEqual(b"3:foo ", marshall("foo"))
示例#4
0
 def test_marshall_list_nested(self):
     self.assertEqual(b"( ( ( 3 ) 4 ) ) ", marshall([[[3], 4]]))
示例#5
0
 def test_marshall_list_mixed(self):
     self.assertEqual(b"( 1 3 4 3:str ) ", marshall([1,3,4,"str"]))
示例#6
0
 def test_marshall_literal(self):
     self.assertEqual(b"foo ", marshall(literal("foo")))
示例#7
0
 def test_marshall_int(self):
     self.assertEqual(b"1 ", marshall(1))
示例#8
0
 def test_marshall_list(self):
     self.assertEqual(b"( 1 2 3 4 ) ", marshall([1,2,3,4]))
示例#9
0
 def test_marshall_list_nested(self):
     self.assertEqual("( ( ( 3 ) 4 ) ) ", marshall([[[3], 4]]))
示例#10
0
 def test_marshall_string_space(self):
     self.assertEqual("5:bla l ", marshall("bla l"))
示例#11
0
 def test_marshall_string(self):
     self.assertEqual("3:foo ", marshall("foo"))
示例#12
0
 def test_marshall_literal(self):
     self.assertEqual("foo ", marshall(literal("foo")))
示例#13
0
 def test_marshall_list_mixed(self):
     self.assertEqual("( 1 3 4 3:str ) ", marshall([1, 3, 4, "str"]))
示例#14
0
 def test_marshall_list(self):
     self.assertEqual("( 1 2 3 4 ) ", marshall([1, 2, 3, 4]))
示例#15
0
 def test_marshall_int(self):
     self.assertEqual("1 ", marshall(1))