def test_decode_str_emptyshortlength(self):
     self.assertEqual(decoder.decode_str(b'0:hello'), b'')
 def test_decode_str_emptylonglength_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_str(b'4:')
 def test_decode_str_empty(self):
     self.assertEqual(decoder.decode_str(b'0:'), b'')
 def test_decode_str_helloworldshortlength(self):
     self.assertEqual(decoder.decode_str(b'5:hello world'), b'hello')
 def test_decode_str_helloworldlonglength_err(self):
     with self.assertRaises(decoder.DecodeError):
         decoder.decode_str(b'11:hello')
 def test_decode_str_helloworld(self):
     self.assertEqual(decoder.decode_str(b'11:hello world'), b'hello world')