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

Method test_add_remove_option_exhaust

test/test_cursor.py:131–144  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

129 self.assertEqual(0, cursor._query_flags)
130
131 def test_add_remove_option_exhaust(self):
132 # Exhaust - which mongos doesn't support
133 if client_context.is_mongos:
134 with self.assertRaises(InvalidOperation):
135 next(self.db.test.find(cursor_type=CursorType.EXHAUST))
136 else:
137 cursor = self.db.test.find(cursor_type=CursorType.EXHAUST)
138 self.assertEqual(64, cursor._query_flags)
139 cursor2 = self.db.test.find().add_option(64)
140 self.assertEqual(cursor._query_flags, cursor2._query_flags)
141 self.assertTrue(cursor._exhaust)
142 cursor.remove_option(64)
143 self.assertEqual(0, cursor._query_flags)
144 self.assertFalse(cursor._exhaust)
145
146 def test_allow_disk_use(self):
147 db = self.db

Callers

nothing calls this directly

Calls 4

nextFunction · 0.90
findMethod · 0.45
add_optionMethod · 0.45
remove_optionMethod · 0.45

Tested by

no test coverage detected