def test_marshall_string_space(self): self.assertEqual(b"5:bla l ", marshall("bla l"))
def send_msg(self, data): marshalled_data = marshall(data) # self.mutter("OUT: %r" % marshalled_data) self.send_fn(marshalled_data)
def test_marshall_string(self): self.assertEqual(b"3:foo ", marshall("foo"))
def test_marshall_list_nested(self): self.assertEqual(b"( ( ( 3 ) 4 ) ) ", marshall([[[3], 4]]))
def test_marshall_list_mixed(self): self.assertEqual(b"( 1 3 4 3:str ) ", marshall([1,3,4,"str"]))
def test_marshall_literal(self): self.assertEqual(b"foo ", marshall(literal("foo")))
def test_marshall_int(self): self.assertEqual(b"1 ", marshall(1))
def test_marshall_list(self): self.assertEqual(b"( 1 2 3 4 ) ", marshall([1,2,3,4]))
def test_marshall_list_nested(self): self.assertEqual("( ( ( 3 ) 4 ) ) ", marshall([[[3], 4]]))
def test_marshall_string_space(self): self.assertEqual("5:bla l ", marshall("bla l"))
def test_marshall_string(self): self.assertEqual("3:foo ", marshall("foo"))
def test_marshall_literal(self): self.assertEqual("foo ", marshall(literal("foo")))
def test_marshall_list_mixed(self): self.assertEqual("( 1 3 4 3:str ) ", marshall([1, 3, 4, "str"]))
def test_marshall_list(self): self.assertEqual("( 1 2 3 4 ) ", marshall([1, 2, 3, 4]))
def test_marshall_int(self): self.assertEqual("1 ", marshall(1))