@@ -78,7 +78,7 @@ def round_tripped(doc):
78
78
79
79
def round_trip (self , doc ):
80
80
bson_bytes = to_bson (doc )
81
- self .assertEqual (doc , self . round_tripped ( doc ))
81
+ self .assertEqual (bson_bytes , bsonjs . loads ( bsonjs . dumps ( bson_bytes ) ))
82
82
# Check compatibility between bsonjs and json_util
83
83
self .assertEqual (doc , json_util .loads (bsonjs .dumps (bson_bytes )))
84
84
self .assertEqual (bson_bytes , bsonjs .loads (json_util .dumps (doc )))
@@ -99,7 +99,6 @@ def test_dbref(self):
99
99
'{ "ref" : { "$ref" : "collection", "$id" : 1, "$db" : "db" } }' ,
100
100
bsonjs_dumps ({"ref" : DBRef ("collection" , 1 , "db" )}))
101
101
102
- @unittest .skip ("CDRIVER-1339" )
103
102
def test_datetime (self ):
104
103
# only millis, not micros
105
104
self .round_trip ({"date" : datetime .datetime (2009 , 12 , 9 , 15 ,
@@ -109,9 +108,9 @@ def test_datetime(self):
109
108
self .assertEqual (EPOCH_AWARE , bsonjs_loads (jsn )["dt" ])
110
109
jsn = '{"dt": { "$date" : "1970-01-01T00:00:00.000Z"}}'
111
110
self .assertEqual (EPOCH_AWARE , bsonjs_loads (jsn )["dt" ])
112
- # No explicit offset
111
+ # No explicit offset or timezone is not supported by libbson
113
112
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 )
115
114
# Localtime behind UTC
116
115
jsn = '{"dt": { "$date" : "1969-12-31T16:00:00.000-0800"}}'
117
116
self .assertEqual (EPOCH_AWARE , bsonjs_loads (jsn )["dt" ])
@@ -179,7 +178,6 @@ def test_uuid(self):
179
178
self .round_trip ({"uuid" :
180
179
uuid .UUID ("f47ac10b-58cc-4372-a567-0e02b2c3d479" )})
181
180
182
- @unittest .skip ("CDRIVER-1340,CDRIVER-1351" )
183
181
def test_binary (self ):
184
182
bin_type_dict = {"bin" : Binary (b"\x00 \x01 \x02 \x03 \x04 " )}
185
183
md5_type_dict = {
0 commit comments