MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / test_put_unicode

Method test_put_unicode

test/test_gridfs.py:409–419  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

407 self.assertFalse(self.fs.exists({"foo": {"$gt": 12}}))
408
409 def test_put_unicode(self):
410 with self.assertRaises(TypeError):
411 self.fs.put("hello")
412
413 oid = self.fs.put("hello", encoding="utf-8")
414 self.assertEqual(b"hello", (self.fs.get(oid)).read())
415 self.assertEqual("utf-8", (self.fs.get(oid)).encoding)
416
417 oid = self.fs.put("aé", encoding="iso-8859-1")
418 self.assertEqual("aé".encode("iso-8859-1"), (self.fs.get(oid)).read())
419 self.assertEqual("iso-8859-1", (self.fs.get(oid)).encoding)
420
421 def test_missing_length_iter(self):
422 # Test fix that guards against PHP-237

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.80
putMethod · 0.45
readMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected