tests/test-cbor.py
changeset 40124 b638219a23c3
parent 39413 babad5ebaf0a
child 41160 a9905045b992
equal deleted inserted replaced
40123:627b0f9baeaf 40124:b638219a23c3
   963                 decoder.decode(encoded[start:start + step])
   963                 decoder.decode(encoded[start:start + step])
   964                 start += step
   964                 start += step
   965 
   965 
   966             self.assertEqual(decoder.getavailable(), [source])
   966             self.assertEqual(decoder.getavailable(), [source])
   967 
   967 
       
   968     def testbytearray(self):
       
   969         source = b''.join(cborutil.streamencode(b'foobar'))
       
   970 
       
   971         decoder = cborutil.bufferingdecoder()
       
   972         decoder.decode(bytearray(source))
       
   973 
       
   974         self.assertEqual(decoder.getavailable(), [b'foobar'])
       
   975 
   968 class DecodeallTests(TestCase):
   976 class DecodeallTests(TestCase):
   969     def testemptyinput(self):
   977     def testemptyinput(self):
   970         self.assertEqual(cborutil.decodeall(b''), [])
   978         self.assertEqual(cborutil.decodeall(b''), [])
   971 
   979 
   972     def testpartialinput(self):
   980     def testpartialinput(self):