def test_int_list_elements(self):
     lst = [1, [], 12]
     eq_(lst, deserialize(serialize(lst)))
 def test_empty(self):
     lst = []
     for depth in range(0, 3):
         eq_(lst, deserialize(serialize(lst)))
         lst = [lst]
     eq_([1], deserialize(serialize([1])))
 def test_empty(self):
     eq_([], deserialize(serialize([])))
 def test_not_one_digit_element(self):
     eq_([10], deserialize(serialize([10])))
 def test_str(self):
     for _ in {"ab", "aba", "]ab", ">a", "<b", "a>", "b]"}:
         eq_(_, deserialize(serialize(_)))
 def test_one_char(self):
     eq_('c', deserialize(serialize('c')))
 def test_empty(self):
     eq_("", deserialize(serialize("")))
 def test_boundaries(self):
     eq_(0, deserialize(serialize(0)))
     eq_(-sys.maxint - 1, deserialize(serialize(-sys.maxint - 1)))
     eq_(sys.maxint, deserialize(serialize(sys.maxint)))
Пример #9
0
	def read_msg(self):
		size = int(self.get_msg(end='\n'))
		data = deserialize(self.get_msg(size))
		return data