@@ -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