def METHOD_NAME(self):
    # Bad byte
    self.assertEqual(b"foo\x80bar".decode("utf-8", "surrogateescape"),
                     "foo\udc80bar")
    self.assertEqual(str("foo\udc80bar").encode("utf-8", "surrogateescape"),
                     b"foo\x80bar")
    # bad-utf-8 encoded surrogate
    # self.assertEqual(b"\xed\xb0\x80".decode("utf-8", "surrogateescape"),
    #                  "\udced\udcb0\udc80")
    self.assertEqual(str("\udced\udcb0\udc80").encode("utf-8", "surrogateescape"),
                     b"\xed\xb0\x80")