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

Method test_alternate_collection

test/test_grid_file.py:134–146  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

132 self.assertEqual(None, f.md5)
133
134 def test_alternate_collection(self):
135 self.db.alt.files.delete_many({})
136 self.db.alt.chunks.delete_many({})
137
138 f = GridIn(self.db.alt)
139 f.write(b"hello world")
140 f.close()
141
142 self.assertEqual(1, self.db.alt.files.count_documents({}))
143 self.assertEqual(1, self.db.alt.chunks.count_documents({}))
144
145 g = GridOut(self.db.alt, f._id)
146 self.assertEqual(b"hello world", g.read())
147
148 def test_grid_in_default_opts(self):
149 self.assertRaises(TypeError, GridIn, "foo")

Callers

nothing calls this directly

Calls 7

writeMethod · 0.95
closeMethod · 0.95
readMethod · 0.95
GridInClass · 0.90
GridOutClass · 0.90
delete_manyMethod · 0.45
count_documentsMethod · 0.45

Tested by

no test coverage detected