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

Method test_list

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

Source from the content-addressed store, hash-verified

132 self.assertEqual(0, self.db.fs.chunks.count_documents({}))
133
134 def test_list(self):
135 self.assertEqual([], self.fs.list())
136 self.fs.put(b"hello world")
137 self.assertEqual([], 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 self.fs.get_last_version()
142 self.assertEqual([], self.fs.list())
143
144 self.fs.put(b"", filename="mike")
145 self.fs.put(b"foo", filename="test")
146 self.fs.put(b"", filename="hello world")
147
148 self.assertEqual({"mike", "test", "hello world"}, set(self.fs.list()))
149
150 def test_empty_file(self):
151 oid = 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