Exemplo n.º 1
0
 def to_string(self):
     '''
     ReadStatus 객체로부터 2개의 문자열을 뽑아낸다.
     '''
     number_list = intlist_to_string([x[0] for x in self.data])
     marker_list = "".join((x[1] for x in self.data))
     return number_list, marker_list
Exemplo n.º 2
0
 def test_intlist_to_string_to_intlist(self):
     a = range(1024, 0, -3)
     b = libs.intlist_to_string(a)
     c = libs.string_to_intlist(b)
     if a != c:
         self.fail(repr(a) + " / " + repr(c))
Exemplo n.º 3
0
 def test_intlist_to_string(self):
     self.assertEqual(
         '\x03\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00',
         libs.intlist_to_string([1, 2, 3]))
Exemplo n.º 4
0
 def test_intlist_to_string_to_intlist(self):
     a = range(1024, 0, -3)
     b = libs.intlist_to_string(a)
     c = libs.string_to_intlist(b)
     if a != c:
         self.fail(repr(a) + " / " + repr(c))
Exemplo n.º 5
0
 def test_intlist_to_string(self):
     self.assertEqual('\x03\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00',
             libs.intlist_to_string([1, 2, 3]))