MCPcopy Create free account
hub / github.com/mongodb/mongo-python-driver / test_list

Method test_list

test/asynchronous/test_gridfs.py:134–148  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

132 self.assertEqual(0, await self.db.fs.chunks.count_documents({}))
133
134 async def test_list(self):
135 self.assertEqual([], await self.fs.list())
136 await self.fs.put(b"hello world")
137 self.assertEqual([], await self.fs.list())
138
139 # PYTHON-598: in server versions before 2.5.x, creating an index on
140 # filename, uploadDate causes list() to include None.
141 await self.fs.get_last_version()
142 self.assertEqual([], await self.fs.list())
143
144 await self.fs.put(b"", filename="mike")
145 await self.fs.put(b"foo", filename="test")
146 await self.fs.put(b"", filename="hello world")
147
148 self.assertEqual({"mike", "test", "hello world"}, set(await self.fs.list()))
149
150 async def test_empty_file(self):
151 oid = await self.fs.put(b"")

Callers

nothing calls this directly

Calls 3

listMethod · 0.45
putMethod · 0.45
get_last_versionMethod · 0.45

Tested by

no test coverage detected