1
- try :
2
- import unittest2 as unittest
3
- except ImportError :
4
- import unittest
1
+ import unittest
5
2
import json
6
3
from decimal import Decimal
7
4
@@ -91,7 +88,7 @@ def test_estado(self):
91
88
self .assertEqual ('SP' , self .endereco .estado .uf )
92
89
93
90
def test_bairro_eh_nulo (self ):
94
- self .assertIsNone (self .endereco .bairro )
91
+ self .assertTrue (self .endereco .bairro is None )
95
92
96
93
97
94
class TestCidade (unittest .TestCase ):
@@ -166,14 +163,14 @@ def test_404(self):
166
163
url = '%s/cep/11111111' % BASE_URL
167
164
httpretty .register_uri (httpretty .GET , url , status = 404 )
168
165
r = postmon .endereco ('11111111' )
169
- self .assertIsNone ( r )
166
+ self .assertTrue ( r is None )
170
167
171
168
@httpretty .activate
172
169
def test_503 (self ):
173
170
url = '%s/cep/22222222' % BASE_URL
174
171
httpretty .register_uri (httpretty .GET , url , status = 503 )
175
172
r = postmon .endereco ('22222222' )
176
- self .assertIsNone ( r )
173
+ self .assertTrue ( r is None )
177
174
178
175
179
176
class TestErrosEstado (unittest .TestCase ):
@@ -183,14 +180,14 @@ def test_404(self):
183
180
url = '%s/uf/xx' % BASE_URL
184
181
httpretty .register_uri (httpretty .GET , url , status = 404 )
185
182
r = postmon .estado ('xx' )
186
- self .assertIsNone ( r )
183
+ self .assertTrue ( r is None )
187
184
188
185
@httpretty .activate
189
186
def test_503 (self ):
190
187
url = '%s/uf/yy' % BASE_URL
191
188
httpretty .register_uri (httpretty .GET , url , status = 503 )
192
189
r = postmon .estado ('yy' )
193
- self .assertIsNone ( r )
190
+ self .assertTrue ( r is None )
194
191
195
192
196
193
class TestErrosCidade (unittest .TestCase ):
@@ -200,11 +197,11 @@ def test_404(self):
200
197
url = '%s/cidade/xx/yy' % BASE_URL
201
198
httpretty .register_uri (httpretty .GET , url , status = 404 )
202
199
r = postmon .cidade ('xx' , 'yy' )
203
- self .assertIsNone ( r )
200
+ self .assertTrue ( r is None )
204
201
205
202
@httpretty .activate
206
203
def test_503 (self ):
207
204
url = '%s/cidade/yy/zz' % BASE_URL
208
205
httpretty .register_uri (httpretty .GET , url , status = 503 )
209
206
r = postmon .cidade ('yy' , 'zz' )
210
- self .assertIsNone ( r )
207
+ self .assertTrue ( r is None )
0 commit comments