Skip to content

Commit aa3845b

Browse files
committed
Update libbson to 1.4.0
Resolves #5.
1 parent a458466 commit aa3845b

File tree

4 files changed

+9
-11
lines changed

4 files changed

+9
-11
lines changed

libbson

Submodule libbson updated 121 files

src/bson/bson-config.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@
161161
/*
162162
* Define to 1 to support experimental future BSON or MongoDB features.
163163
*/
164-
#define BSON_EXPERIMENTAL_FEATURES 0
164+
#define BSON_EXPERIMENTAL_FEATURES 1
165165
#if BSON_EXPERIMENTAL_FEATURES != 1
166166
# undef BSON_EXPERIMENTAL_FEATURES
167167
#endif

src/bson/bson-version.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
*
3838
* BSON minor version component (e.g. 2 if %BSON_VERSION is 1.2.3)
3939
*/
40-
#define BSON_MINOR_VERSION (3)
40+
#define BSON_MINOR_VERSION (4)
4141

4242

4343
/**
4444
* BSON_MICRO_VERSION:
4545
*
4646
* BSON micro version component (e.g. 3 if %BSON_VERSION is 1.2.3)
4747
*/
48-
#define BSON_MICRO_VERSION (5)
48+
#define BSON_MICRO_VERSION (0)
4949

5050

5151
/**
@@ -60,7 +60,7 @@
6060
*
6161
* BSON version.
6262
*/
63-
#define BSON_VERSION (1.3.5)
63+
#define BSON_VERSION (1.4.0)
6464

6565

6666
/**
@@ -69,7 +69,7 @@
6969
* BSON version, encoded as a string, useful for printing and
7070
* concatenation.
7171
*/
72-
#define BSON_VERSION_S "1.3.5"
72+
#define BSON_VERSION_S "1.4.0"
7373

7474

7575
/**

test/test_bsonjs.py

+3-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def round_tripped(doc):
7878

7979
def round_trip(self, doc):
8080
bson_bytes = to_bson(doc)
81-
self.assertEqual(doc, self.round_tripped(doc))
81+
self.assertEqual(bson_bytes, bsonjs.loads(bsonjs.dumps(bson_bytes)))
8282
# Check compatibility between bsonjs and json_util
8383
self.assertEqual(doc, json_util.loads(bsonjs.dumps(bson_bytes)))
8484
self.assertEqual(bson_bytes, bsonjs.loads(json_util.dumps(doc)))
@@ -99,7 +99,6 @@ def test_dbref(self):
9999
'{ "ref" : { "$ref" : "collection", "$id" : 1, "$db" : "db" } }',
100100
bsonjs_dumps({"ref": DBRef("collection", 1, "db")}))
101101

102-
@unittest.skip("CDRIVER-1339")
103102
def test_datetime(self):
104103
# only millis, not micros
105104
self.round_trip({"date": datetime.datetime(2009, 12, 9, 15,
@@ -109,9 +108,9 @@ def test_datetime(self):
109108
self.assertEqual(EPOCH_AWARE, bsonjs_loads(jsn)["dt"])
110109
jsn = '{"dt": { "$date" : "1970-01-01T00:00:00.000Z"}}'
111110
self.assertEqual(EPOCH_AWARE, bsonjs_loads(jsn)["dt"])
112-
# No explicit offset
111+
# No explicit offset or timezone is not supported by libbson
113112
jsn = '{"dt": { "$date" : "1970-01-01T00:00:00.000"}}'
114-
self.assertEqual(EPOCH_AWARE, bsonjs_loads(jsn)["dt"])
113+
self.assertRaises(ValueError, bsonjs_loads, jsn)
115114
# Localtime behind UTC
116115
jsn = '{"dt": { "$date" : "1969-12-31T16:00:00.000-0800"}}'
117116
self.assertEqual(EPOCH_AWARE, bsonjs_loads(jsn)["dt"])
@@ -179,7 +178,6 @@ def test_uuid(self):
179178
self.round_trip({"uuid":
180179
uuid.UUID("f47ac10b-58cc-4372-a567-0e02b2c3d479")})
181180

182-
@unittest.skip("CDRIVER-1340,CDRIVER-1351")
183181
def test_binary(self):
184182
bin_type_dict = {"bin": Binary(b"\x00\x01\x02\x03\x04")}
185183
md5_type_dict = {

0 commit comments

Comments
 (0)