Commit Graph

72 Commits

Author SHA1 Message Date
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
fb20975a1f
PYTHON-2245 Change default uuidRepresentation to UNSPECIFIED (ie disable UUID encoding by default) (#724)
This change also stops decoding both 3 and 4 subtypes as UUIDs.
With standard, only subtype 4 is decoded to UUID and subtype 3 is decoded to Binary.
With legacy representations, only subtype 3 is decoded to UUID and subtype 4 is decoded to Binary.
2021-09-14 16:48:52 -07:00
Prashant Mital
9055bb09e6
PYTHON-2702 Remove deprecated URI options (#710) 2021-08-20 10:17:06 -07:00
Shane Harvey
65aa7c86d5
PYTHON-2850 Remove map_reduce/inline_map_reduce (#703) 2021-08-12 09:44:52 -07:00
Shane Harvey
5fd175c0d8
PYTHON-2529 Remove UUIDLegacy (#698) 2021-08-06 16:52:41 -07:00
Prashant Mital
4760d07815
PYTHON-2152 Expand native UUID handling support; Implement UUID specification 2020-06-01 17:45:08 -07:00
Bernie Hackett
e6b0f3847d PYTHON-1581 - Deprecate Collection/Cursor count 2018-06-18 10:50:26 -07:00
Bernie Hackett
dbf386c18c PYTHON-1527 - Fix default writeConcern override 2018-06-04 13:56:06 -07:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
A. Jesse Jiryu Davis
3cba982db9 PYTHON-1332 - Test lsid with all commands 2017-09-29 14:52:26 -04:00
Bernie Hackett
53bd24bfc3 PYTHON-1260 - Deprecate the group helper 2017-07-18 10:54:33 -07: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
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
aa090fe393 PYTHON-821 - Small test fixes. 2015-02-19 10:36:42 -08:00
Bernie Hackett
a817fa9a28 PYTHON-821 - Add test_legacy_api.py 2015-02-19 09:32:14 -08:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
Bernie Hackett
7416e6595c PYTHON-821 - Implement find_one_and_*.
This change also deprecates find_and_modify. Migrate
to find_one_and_delete, find_one_and_update, and/or
find_one_and_replace.
2015-02-10 12:09:47 -08:00
A. Jesse Jiryu Davis
9da835ab3d PYTHON-825 BSON API changes and internal options handling.
This change resolves four issues:

PYTHON-826 The new codec_options submodule is moved from pymongo to bson.

PYTHON-827 Use codec_options in BSON APIs.

Functions and methods of the bson module that accepted the options as_class,
tz_aware, and uuid_subtype now accept a codec_options parameter instead.

For example, the function definition for bson.decode_all changes from this:

def decode_all(data, as_class=dict, tz_aware=True,
               uuid_subtype=OLD_UUID_SUBTYPE)

to:

def decode_all(data, codec_options=CodecOptions())

The following functions are changed:

- decode_all
- decode_iter
- decode_file_iter

The following methods are changed:

- BSON.encode
- BSON.decode

This is a breaking change for any application that uses the BSON API directly
and changes any of the named parameter defaults. No changes are required for
applications that use the default values for these options. The behavior
remains the same.

PYTHON-828 Internal BSON module changes to support CodecOptions

The pure Python BSON module passes around a CodecOptions instance instead of
as_class, tz_aware, and uuid_subtype. C extensions pass these values around in
a struct.

PYTHON-801 Rename uuid_subtype to uuid_representation.
2015-02-05 23:09:23 -06: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
0a75f04384 Remove pre-MongoDB-2.0 version checks from tests. 2015-01-26 16:19:12 -05:00
Bernie Hackett
b7b627d822 PYTHON-798 - Make common.BaseObject immutable
This change makes the codec_options, read_preference, and
write_concern attributes of MongoClient, Database, and
Collection read only. If you need to change any of these
options per-instance use MongoClient.get_database,
Database.get_collection, or Collection.with_options instead.
2015-01-12 10:35:28 -08:00
Bernie Hackett
a3fb2462bb PYTHON-801 - Remove BaseObject.uuid_subtype 2014-12-29 07:34:07 -08:00
Bernie Hackett
1b1457ab1f PYTHON-677 - Finish transition to WriteConcern. 2014-12-20 22:34:48 -08:00
Bernie Hackett
a72d95b229 PYTHON-803 - Don't use Collection.find() for commands.
This change introduces a _command helper in the helpers
module, used by Database.command and various internal and
external command helpers instead of iterating a Cursor
instance.

This change also introduces a small incompatibility with
earier versions. The as_class and fields options have been
removed from Database.command. They were never documented
and only used by some internal helpers. This also removes
the documented uuid_subtype option. A forthcoming API
refactor will replace that functionality.
2014-12-16 14:37:43 -08: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
60217e4e19 Fix race in test_common. 2014-11-02 15:34:48 -05:00
A. Jesse Jiryu Davis
7e6433b6bd Fix tests of MongoClient.host property.
Inadvertently used an RS client instead of a direct one,
when a replica set is available.
2014-10-31 16:38:32 -04:00
A. Jesse Jiryu Davis
0a246d2033 Standardize how tests construct MongoClients. 2014-10-30 19:36:59 -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
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
behackett
86c0df0341 Use catch_warnings to test warnings. 2014-04-28 11:49:50 -07: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
b26459cd6a Remove useless uuid module checks.
These were only needed for python 2.4 which does
not provide a uuid module.
2014-04-24 10:09:21 -07:00
Bernie Hackett
4704bb8eb1 PYTHON-677 - Switch internals to new WriteConcern class 2014-04-21 17:13:04 -07:00
behackett
de23b63994 PYTHON-526 Remove get/set/unset_lasterror_options
Use <object>.write_concern instead.
2014-04-05 12:27:38 -07:00
Bernie Hackett
85db128efd PYTHON-526 Remove the "safe" option.
Use w=0 for unacknowledged write operations.
2014-04-04 17:15:50 -07:00
Bernie Hackett
e08aa1f90d PYTHON-525 Remove (ReplicaSet)Connection.
Use MongoClient or MongoReplicaSetClient instead.
2014-04-04 16:56:25 -07: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
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
add8d4fd6a More warnings cleanup. 2013-10-31 12:04:21 -07:00
A. Jesse Jiryu Davis
459d34fd93 Unused import 2013-10-20 17:18:32 -04:00
behackett
0217091284 Fix tests with MongoDB 2.5.x and --nojournal. 2013-09-24 18:15:37 -07:00
hawka
74546ec88d Adding Support for readPreferenceTags and uuidRepresentation in URI parsing. PYTHON-473 2013-08-30 15:38:34 -04:00
Ross Lawley
bc6368dafa Fixing write concern logic on a collection - PYTHON-474
Adding warnings in documentation about a change
in side effects when calling write_concern
2013-03-21 09:42:50 +00:00
A. Jesse Jiryu Davis
8536acb4a0 Standardize tests' handling of DB_IP and DB_PORT, fix PYTHON-475 2013-02-19 15:09:28 -05:00