@@ -149,21 +149,22 @@ def test_dict_float(self):
149
149
def test_dict_complex (self ):
150
150
x = {'foo' : 1.0 + 1.0j , 'bar' : 2.0 + 2.0j }
151
151
x_rec = self .encode_decode (x )
152
- self .assertTrue (all (map (lambda x , y : x == y , x .values (), x_rec .values ())) and
153
- all (map (lambda x , y : type (x ) == type (y ), x .values (), x_rec .values ())))
152
+ self .assertEqual (x , x_rec )
153
+ for key in x :
154
+ self .assertEqual (type (x [key ]), type (x_rec [key ]))
154
155
155
156
def test_dict_numpy_float (self ):
156
157
x = {'foo' : np .float32 (1.0 ), 'bar' : np .float32 (2.0 )}
157
158
x_rec = self .encode_decode (x )
158
159
tm .assert_almost_equal (x ,x_rec )
159
160
160
161
def test_dict_numpy_complex (self ):
161
- x = {'foo' : np .complex128 (
162
- 1.0 + 1.0j ), 'bar' : np .complex128 (2.0 + 2.0j )}
162
+ x = {'foo' : np .complex128 (1.0 + 1.0j ),
163
+ 'bar' : np .complex128 (2.0 + 2.0j )}
163
164
x_rec = self .encode_decode (x )
164
- self .assertTrue ( all ( map ( lambda x , y : x == y , x . values (), x_rec . values ())) and
165
- all ( map ( lambda x , y : type ( x ) == type ( y ), x . values (), x_rec . values ())))
166
-
165
+ self .assertEqual ( x , x_rec )
166
+ for key in x :
167
+ self . assertEqual ( type ( x [ key ]), type ( x_rec [ key ]))
167
168
168
169
def test_numpy_array_float (self ):
169
170
0 commit comments