Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_ensure_utf8_bytes(self):
self.assertEqual(ensure_utf8_bytes(u"abc"), "abc")
self.assertEqual(ensure_utf8_bytes(u"\u2202"), "\xe2\x88\x82")
self.assertEqual(ensure_utf8_bytes("\xe2\x88\x82"), "\xe2\x88\x82")
def test_ensure_utf8_bytes(self):
self.assertEqual(ensure_utf8_bytes(u"abc"), "abc")
self.assertEqual(ensure_utf8_bytes(u"\u2202"), "\xe2\x88\x82")
self.assertEqual(ensure_utf8_bytes("\xe2\x88\x82"), "\xe2\x88\x82")
def test_ensure_utf8_bytes(self):
self.assertEqual(ensure_utf8_bytes(u"abc"), "abc")
self.assertEqual(ensure_utf8_bytes(u"\u2202"), "\xe2\x88\x82")
self.assertEqual(ensure_utf8_bytes("\xe2\x88\x82"), "\xe2\x88\x82")