Commit Graph

129 Commits

Author SHA1 Message Date
aherlihy
596f80fc8d PYTHON-985 - MongoClient properties now block until connected 2015-11-18 15:02:38 -08:00
aherlihy
5396444f3c PYTHON-978 - Use killCursors command 2015-11-18 12:57:48 -08:00
aherlihy
1a3aeea426 PYTHON-978 - Use find/getMore commands 2015-11-18 12:57:47 -08:00
aherlihy
193915e636 PYTHON-959 - Connection string spec compliance. 2015-08-06 13:14:31 -04:00
Luke Lovett
43683041fe PYTHON-928 - Fix tests around client __repr__ to expect original seed list instead of discovered nodes. 2015-07-17 15:57:23 -07:00
Luke Lovett
5f14e1b9bf PYTHON-928 - Enhance __repr__ of MongoClient with other options passed in to the constructor. 2015-07-17 14:49:36 -07:00
aherlihy
1e7ebb1792 PYTHON-933 - "maxPoolSize=0" allowed, causes hang. 2015-06-08 14:23:00 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
d2f9807cd1 PYTHON-857 - Remove MongoClient.(min|max)_wire_version.
The min_wire_version and max_wire_version attributes have
always been racy when connected to a mixed version replica set
or any sharded cluster. When connected to a mongos all you know
is the wire version of that mongos, not the shards behind it.
With mongos load balancing this problem is even worse, since
each operation could possibly be executed on a different mongo
version during an upgrade.
2015-03-24 14:38:25 -07:00
Bernie Hackett
b136092a22 PYTHON-857 - Delete test_wire_version_mongos_ha. 2015-03-24 13:27:25 -07:00
A. Jesse Jiryu Davis
73fe2826d4 PYTHON-857 - Delete MongoClient._send_message.
The deleted test_stale_killcursors was redundant with
test_kill_cursors_with_server_unavailable.
2015-03-20 09:41:24 -04:00
A. Jesse Jiryu Davis
44712e1e3d PYTHON-857 - Fix server-reset logic. 2015-03-16 18:29:45 -04:00
aherlihy
70c06d11a9 PYTHON-813 Removed client_knobs where no longer needed 2015-03-11 13:03:59 -07:00
Bernie Hackett
c87424e7af PYTHON-856 - as_class -> document_class
This commit changes the name of the as_class option
in CodecOptions to document_class, to match the name
of the MongoClient option.
2015-03-09 14:32:42 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
Bernie Hackett
4fd6f8a0b1 PYTHON-854 max_pool_size -> maxPoolSize
With this change the max_pool_size named parameter to
MongoClient is removed. It is replaced by the maxPoolSize
MongoDB URI option, which can be passed in a URI, or as a
keyword argument to MongoClient.
2015-03-09 10:08:13 -07:00
Bernie Hackett
d9c165bbe8 PYTHON-851 - Fix a test. 2015-03-08 23:20:36 -07:00
Bernie Hackett
6bacdaafaa PYTHON-851 - Clean up MongoClient properties. 2015-03-08 20:23:07 -07:00
Bernie Hackett
b71526a2da PYTHON-836 - Always set slaveOk bit for non-mongos direct connection. 2015-03-07 11:09:16 -08:00
Bernie Hackett
d69f76d380 Finalize option locations and exports.
- Move ReturnDocument to pymongo.collection.
- Change ReturnDocument.Before to ReturnDocument.BEFORE
- Change ReturnDocument.After to ReturnDocument.AFTER
- Add pymongo.cursor.CursorType.
- Move pymongo.cursor.NON_TAILABLE and friends to attributes of CursorType.
- read_preferences.ReadPreference is once again an "enum".
- Fix docs for read_preferences.ReadPreference.
- Rename pymongo.options to pymongo.operations.
- Export CursorType, ReturnDocument, WriteConcern, and public classes
  from pymongo.opertions through pymongo/__init__.py
- Fix up a number of documentation issues in the process.
2015-03-05 11:35:46 -08:00
A. Jesse Jiryu Davis
7dbcc4b71a PYTHON-726 - Test in gevent and eventlet. 2015-03-02 16:36:02 -05:00
Bernie Hackett
8f0bd0a6d4 PYTHON-850 - Change some uses of ConfigurationError to Type/ValueError. 2015-02-26 16:02:25 -08:00
A. Jesse Jiryu Davis
7f42430978 PYTHON-847 Remove disconnect(), synonym of MongoClient.close().
close() seems more standard among MongoDB drivers.
2015-02-25 14:52:34 -05:00
A. Jesse Jiryu Davis
e7a1b261cd PYTHON-848 Remove MongoClient.alive.
The ``alive`` method is removed since it no longer
provides meaningful information; even if the client is disconnected,
it may discover a server in time to fulfill the next operation.
2015-02-25 14:51:06 -05:00
Bernie Hackett
029bbe5080 PEP8 / Pylint cleanups. 2015-02-23 14:43:28 -08:00
Bernie Hackett
d717bc6a4b Skip forking tests if we don't have multiprocessing. 2015-02-18 15:25:13 -08:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
A. Jesse Jiryu Davis
a2c13090d8 PYTHON-826 Move codec_options submodule from pymongo to bson. 2015-02-02 09:38:49 -05:00
A. Jesse Jiryu Davis
301bf8066c Replace more tearDowns with addCleanup. 2015-01-26 16:38:16 -05:00
A. Jesse Jiryu Davis
0a75f04384 Remove pre-MongoDB-2.0 version checks from tests. 2015-01-26 16:19:12 -05:00
A. Jesse Jiryu Davis
db4edc63aa Fix test_init_disconnected.
It failed when the replica set config contains hostnames that differ from the
DB_IP environment variable that PyMongo's tests use. E.g. if DB_IP is
"127.0.0.1" but the replica set is configured to use hostnames like
"localhost:27017", then test_init_disconnected failed because the tests' global
"host" variable is "127.0.0.1" but MongoClient.host is "localhost".
2015-01-22 10:13:39 -05:00
A. Jesse Jiryu Davis
21937f4f52 Race in test_exhaust_getmore_server_error. 2015-01-21 14:44:54 -05:00
A. Jesse Jiryu Davis
738c48c92c Let test_network_error_on_operation succeed without a server. 2015-01-20 12:08:53 -05:00
behackett
c07e543e58 PYTHON-820 - API changes for find/find_one to comply with CRUD spec.
- Changed parameter names (default values and behaviors remain the same):
  - spec (spec_or_id in find_one) -> filter
  - fields -> projection
  - partial -> allow_partial_results

- The "timeout" option is renamed to "no_cursor_timeout" with its default
  changed to False.

- The tailable, await_data, and exhaust options will be replaced with a
  cursor_type option. Valid values:
  - cursor.NON_TAILABLE
  - cursor.TAILABLE
  - cursor.TAILABLE_AWAIT
  - cursor.EXHAUST

- The following options are added:
  - oplog_replay (bool - default False) - only valid with tailable cursors
    against the oplog.
  - modifiers (document - default None) - A dict of query modifiers. See
    http://docs.mongodb.org/manual/reference/operator/query-modifier/#modifiers for
    options.

- The following options are removed, replaced by the "modifiers" option:
  - max_scan
  - snapshot

- The as_class option is removed. Use Collection.with_options instead.
2015-01-19 22:10:56 -08:00
A. Jesse Jiryu Davis
47a736da89 PYTHON-799 Avoid deadlock in Cursor destructor with PyPy.
Use a background thread to periodically close destroyed
cursors instead of killing them directly from Cursor.__del__.
2015-01-05 15:21:51 -05:00
Bernie Hackett
1b1457ab1f PYTHON-677 - Finish transition to WriteConcern. 2014-12-20 22:34:48 -08:00
A. Jesse Jiryu Davis
4ca6047c8c Race in test_network_error_on_operation. 2014-12-18 09:32:44 -05:00
A. Jesse Jiryu Davis
f0daebf4bb PYTHON-799 Create a PeriodicExecutor class for background monitoring.
The executor will also be used to solve a deadlock in Cursor.__del__.
2014-12-17 13:19:05 -05:00
Bernie Hackett
550f25370e PYTHON-802 - Add get_database and get_collection methods 2014-12-15 11:01:29 -08:00
A. Jesse Jiryu Davis
bafb8c7b44 Fix race in TestMongoClientFailover.test_discover_primary. 2014-11-25 17:41:34 -05:00
A. Jesse Jiryu Davis
8be5f2b382 test_client style. 2014-11-24 18:15:36 -05:00
A. Jesse Jiryu Davis
83ab167f0c test_network_error_on_operation can run without a server. 2014-11-24 18:15:35 -05:00
A. Jesse Jiryu Davis
b85beec98b test_lazy_connect_w0 can break the next test. 2014-11-24 12:56:33 -05:00
A. Jesse Jiryu Davis
e8be121a89 PYTHON-785 Don't use requests in tests. 2014-11-20 22:57:56 -05:00
A. Jesse Jiryu Davis
1732b09155 Remove TestClientLazyConnectBadSeeds.
It isn't testing anything, and it can interfere with later tests: on Mac,
there's a global getaddrinfo lock. TestClientLazyConnectBadSeeds
starts 10 threads and doesn't join them, so they're still vying for the
lock as the next tests run.
2014-11-17 20:34:56 -05:00
A. Jesse Jiryu Davis
79b02fdd56 Shorter timeout in connection-failure tests. 2014-11-17 20:34:25 -05:00
A. Jesse Jiryu Davis
dedf203be9 Typo in test_host_w_port. 2014-11-17 20:34:25 -05:00
A. Jesse Jiryu Davis
0e222c4c4c Rename "set_name" to "replica_set_name".
Rename the attributes of IsMaster, ServerDescription, TopologyDescription, and
TopologySettings from "set_name" to "replica_set_name" for greater clarity.
2014-11-17 20:29:16 -05:00
A. Jesse Jiryu Davis
43a5349c48 Fix test_stale_getmore and test_stale_killcursors. 2014-11-14 22:37:23 -05:00
A. Jesse Jiryu Davis
5c8884c44b PYTHON-788 Remove copy_database helper method. 2014-11-13 14:05:10 -05:00