Commit Graph

98 Commits

Author SHA1 Message Date
Ben Warner
4ae93c4937
PYTHON-1552 Prevent uploading partial or corrupt GridFS files after an error occurs 2022-06-16 15:26:27 -07:00
Steven Silvester
5578999a90
PYTHON-1834 Use a code formatter (#852) 2022-02-09 06:44:28 -06:00
Steven Silvester
f4cef37328
PYTHON-3064 Add typings to test package (#844) 2022-02-07 19:33:41 -06:00
Shane Harvey
e27131546c
PYTHON-2998 Remove md5 checksums from gridfs and remove disable_md5 (#776)
Speed up gridfs tests (shaves off about 2 minutes on macOS).
2021-11-04 17:25:11 -07:00
Shane Harvey
e1b068d37a
PYTHON-2525 Remove Collection.count and Cursor.count (#700) 2021-08-10 13:52:29 -07:00
Shane Harvey
6bc5e088af
PYTHON-1272 Fix deadlock when garbage collecting pinned cursors and sessions (#642)
It's not safe to return the pinned connection to the pool from within
Cursor.del because the Pool's lock may be held by a python thread
while the cyclic garbage collector runs. Instead we send the cursor
cleanup request to the client's background thread. The thread will
send killCursors on the pinned socket and then return the socket to
the pool.
Also fixed a similar bug when garbage collecting a pinned session.
2021-06-22 17:29:26 -07:00
Prashant Mital
ff6ca53328
PYTHON-2572 Introduce NotPrimaryError and deprecate NotMasterError (#646) 2021-06-22 13:24:07 -07:00
Bernie Hackett
e17299ab2e PYTHON-2133 Remove u prefixes from code 2021-01-20 16:10:23 -08:00
Bernie Hackett
a72e8b8823 PYTHON-2133 Remove py2 support from test
Also delete bson/py3compat.py
2021-01-20 09:40:36 -08:00
Shane Harvey
56925fd97f
PYTHON-1321 Remove MongoReplicaSetClient (#552) 2021-01-15 17:11:15 -08:00
Bernie Hackett
709b28467f PYTHON-1586 - Deprecate database_names and collection_names 2018-06-18 10:52:11 -07:00
Bernie Hackett
e6b0f3847d PYTHON-1581 - Deprecate Collection/Cursor count 2018-06-18 10:50:26 -07:00
Bernie Hackett
1c7085d371 PYTHON-1458 - Make MD5 digest optional in GridFS 2018-03-30 18:59:19 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Bernie Hackett
9693170982 PYTHON-1265 - More reliable gridfs replica tests 2017-04-03 14:46:30 -07:00
Bernie Hackett
ba6ef88d10 PYTHON-1026 - Single member replica set testing 2016-11-15 15:25:04 -08:00
Shane Harvey
5905a86785 PYTHON-1075 Support running the entire test suite with SSL/TLS
SSL connections are configurable via the environment variables
"CLIENT_PEM", "CA_PEM", and "CERT_REQS".
2016-09-28 16:34:14 -07:00
Bernie Hackett
e89ba4bcd0 PYTHON-1026 - Remove test assumption about primary host 2016-09-21 11:15:43 -07:00
Bernie Hackett
53a7bea492 PYTHON-1022 - Drop support for Python 3.2
This change removes the u() helper from bson.py3compat
and all of its uses in the driver and tests. PyPy3 continues
to be supported since, even though it is based on python 3.2.5,
it has always supported the u string prefix.

The README and install docs are now explicit about PyPy(3) support.
2016-06-15 10:05:43 -07:00
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