'Tests inserting a gridfs file'

def test_insert_file(self):

    fs = GridFS(self.conn['test'], 'test')
    test_data = 'test_insert_file    test    file'
    id = fs.put(test_data, filename='test.txt', encoding='utf8')
    assert_soon((lambda : (sum((1 for _ in self._search())) > 0)))
    res = list(self._search())
    self.assertEqual(len(res), 1)
    doc = res[0]
    self.assertEqual(doc['filename'], 'test.txt')
    self.assertEqual(doc['_id'], id)
    self.assertEqual(doc['content'], test_data)
