Commit Graph

79 Commits

Author SHA1 Message Date
Bernie Hackett
08a668f36d PYTHON-1019 - GridIn must use ReadPreference.PRIMARY 2015-12-07 11:23:06 -08:00
Bernie Hackett
52ebf27413 Remove arbitrary wtimeout from gridfs tests 2015-10-15 21:02:13 -07:00
aherlihy
b9baa8ae8a PYTHON-960 - GridFS spec compliance 2015-08-06 12:41:40 -04:00
aherlihy
6b644054b7 PYTHON-860 - Ignore unauthorized errors for index creation in GridFs 2015-07-21 12:33:34 -04:00
Bernie Hackett
5fcc5c72ac PYTHON-951 - Raise CorruptGridFile for truncated chunks. 2015-06-16 16:43:15 -07:00
A. Jesse Jiryu Davis
edde3d6576 PYTHON-900 - Python 3-compatible test. 2015-04-17 17:33:14 -04:00
behackett
42fc925b11 PYTHON-900 - Fix GridFS.delete(). 2015-04-16 20:20:22 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
A. Jesse Jiryu Davis
f757eb0433 Some unused imports in tests. 2015-03-11 21:56:44 -04:00
aherlihy
70c06d11a9 PYTHON-813 Removed client_knobs where no longer needed 2015-03-11 13:03:59 -07:00
aherlihy
fa1466179f PYTHON-813 Added support for serverSelectionTimeoutMS 2015-03-09 12:38:24 -07:00
Bernie Hackett
12d74ff56f PYTHON-821 - Use new CRUD API in GridFS. 2015-02-13 13:12:58 -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
565e5faeb9 No more need to call MongoClient.close in tests. 2015-01-26 16:38:16 -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
fab611f63c PYTHON-785 Don't use requests in GridFS. 2014-11-21 20:19:40 -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
4eef9836d9 Import style in test_gridfs. 2014-11-03 15:36:27 -05:00
Bernie Hackett
370e9f25c6 PYTHON-762 - Use listIndexes for index_information 2014-10-31 13:25:18 -07:00
A. Jesse Jiryu Davis
0a246d2033 Standardize how tests construct MongoClients. 2014-10-30 19:36:59 -04:00
A. Jesse Jiryu Davis
935f8b7275 Test GridFS.find_one. 2014-10-28 16:20:53 -04:00
A. Jesse Jiryu Davis
ff6a5430fb PYTHON-749 Test that GridOut handles chunkSize as a float.
(cherry picked from commit fedad11)
2014-10-08 13:00:12 -04:00
A. Jesse Jiryu Davis
c5eae2f99f Use replica set connection in tests wherever possible.
Most tests now inherit from IntegrationTest and use self.client for all MongoDB
operations. self.client is now a replica set connection if an RS is available,
otherwise a connection to a standalone.
2014-10-07 13:36:52 -04:00
A. Jesse Jiryu Davis
735a1247ca PYTHON-525 Deprecate MongoReplicaSetClient.
MongoClient now supports all MongoReplicaSetClient's features.
Fix bugs and add features in the new MongoClient to bring it up
to spec. MongoReplicaSetClient is now a deprecated stub that
subclasses MongoClient.

Introduce new errors, NetworkTimeout and NotMasterError, to
communicate events that MongoClient must handle specially.
2014-09-16 15:33:19 -04:00
A. Jesse Jiryu Davis
2f9d24ade6 PYTHON-525 Reimplement MongoClient to use Cluster.
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.

Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
2014-08-28 16:57:57 -04:00
Luke Lovett
d7ec3a7704 PYTHON-715 Fix tests for MongoDB >= 2.7.1 when running with auth enabled. 2014-07-07 19:05:21 +00:00
Luke Lovett
4fa96c6c2e PYTHON-683 Separate unit tests and integration tests in the pymongo test suite.
Raise SkipTest in tests that require a connection to MongoDB when none is available.
2014-06-30 17:42:29 +00:00
Luke Lovett
26fb43cf78 PYTHON-681 Reuse MongoClient whenever possible in the tests 2014-05-21 20:41:18 +00:00
Luke Lovett
141200083e PYTHON-680 Stop using nose in favor of pure unittest/unittest2 2014-04-25 22:57:33 +00:00
Bernie Hackett
0a55f923c4 PYTHON-686 - Finish updating docs related to python 3.
Mostly removing references to 2to3, which we no longer use.
2014-04-24 10:35:20 -07:00
Luke Lovett
4d6d1e067b PYTHON-676 python 2/3 single-source for the test module 2014-04-23 18:37:02 +00:00
Bernie Hackett
48a65eb9c1 PYTHON-526 Drop support for slaveOk/slave_okay.
Use any ReadPreference other than PRIMARY instead.
2014-04-04 16:37:32 -07:00
A. Jesse Jiryu Davis
3a4d894afa Lower default GridFS chunk size to 255k, PYTHON-661. 2014-03-24 16:37:10 -04:00
A. Jesse Jiryu Davis
3076a2113e Race condition in GridFS test.
test_gridfs_secondary_lazy asserts that get_last_version on a secondary raises
NoFile. This fails if setUp()'s dropCollection command hasn't yet replicated:
there's still a file on the secondary.
2014-03-10 08:48:04 -04:00
Bernie Hackett
0318510ba1 Fix a gridfs test on Windows. 2014-03-04 15:37:02 -08:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
3a197c8467 Fix GridOutCursor iteration in py3 PYTHON-310 2014-01-13 18:14:13 -08:00
Kyle Erf
237754dbef PYTHON-310: Added find() method to gridfs
Allows iteration through arbitrary queries against the files collection using
a new GridOutCursor class.
2014-01-06 14:57:00 -08:00
A. Jesse Jiryu Davis
2a1724c633 Option to lazily connect GridFS and GridOut, always lazily connect GridIn. 2013-12-05 15:16:18 -05:00
A. Jesse Jiryu Davis
394711330d Ensure GridFS.list() never includes None, PYTHON-598. 2013-12-05 10:04:47 -05:00
A. Jesse Jiryu Davis
f1f7b14bf6 Allow MongoClients to be GC'ed after test runs.
Work around http://bugs.python.org/issue11798 to reduce max connection count during tests.
2013-08-27 09:00:50 -04:00
A. Jesse Jiryu Davis
c758efcb34 Rename test_connection -> test_client, test_replica_set_connection -> test_replica_set_client PYTHON-451 2013-02-11 21:33:55 -05:00
A. Jesse Jiryu Davis
d35bec12e5 Tests use MongoClient instead of Connection PYTHON-451 2013-02-11 20:57:17 -05:00
Ross Lawley
2435f8609d GridFS.new_file fails to raise FileExists
When using a manual _id - PYTHON-453
2013-01-07 14:30:04 +00:00
A. Jesse Jiryu Davis
b47f679a17 GridFS writes must be in request PYTHON-423 2012-11-19 16:25:09 -05:00
behackett
c188836d64 Fallback to StringIO if cStringIO doesn't exist. 2012-08-03 14:28:53 -07:00
A. Jesse Jiryu Davis
f275b2291a Implement read preferences for distributing reads among replica set members PYTHON-367
Replace the 'mongo' dict with a Member object everywhere in ReplicaSetConnection.
A handful of commands obey read preferences; most are always sent to primary.
Track a 5-sample moving average of each replica set member's ping time.
Connection detects whether it's connected to primary, secondary, or mongos.
2012-07-25 00:05:06 -04:00
A. Jesse Jiryu Davis
f2cd5c6f2b Slightly refactor threading tests 2012-04-29 21:34:05 -04:00
A. Jesse Jiryu Davis
5108100457 Ensure all test threads are daemonic, attempt a more reliable Master Slave test_kill_cursor_explicit 2012-04-21 14:28:46 -04:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00