def _check_to_bytes(self, in_string, encoding, expected):
 self.assertEqual(to_bytes(in_string, encoding), expected)

def _check_to_bytes ( self , in_string , encoding , expected ) : self . assertEqual ( to_bytes ( in_string , encoding ) , expected )
test happy path of encoding to bytes .