@@ -201,7 +201,7 @@ def test_none_states(self):
201201 hump_device = humps .decamelize (RAW_DEVICES )
202202 del hump_device ["states" ]
203203 device = Device (** hump_device )
204- assert not device .states .get (STATE )
204+ assert device .states .get (STATE ) is None
205205
206206
207207class TestStates :
@@ -211,19 +211,19 @@ def test_empty_states(self):
211211 """An empty list yields an empty States object with no state found."""
212212 states = States ([])
213213 assert not states
214- assert not states .get (STATE )
214+ assert states .get (STATE ) is None
215215
216216 def test_none_states (self ):
217217 """A None value for states should behave as empty."""
218218 states = States (None )
219219 assert not states
220- assert not states .get (STATE )
220+ assert states .get (STATE ) is None
221221
222222 def test_getter (self ):
223223 """Retrieve a known state and validate its properties."""
224224 states = States (RAW_STATES )
225225 state = states .get (STATE )
226- assert state
226+ assert state is not None
227227 assert state .name == STATE
228228 assert state .type == DataType .STRING
229229 assert state .value == "alarm name"
@@ -232,7 +232,7 @@ def test_getter_missing(self):
232232 """Requesting a missing state returns falsy (None)."""
233233 states = States (RAW_STATES )
234234 state = states .get ("FooState" )
235- assert not state
235+ assert state is None
236236
237237
238238class TestState :
@@ -247,7 +247,7 @@ def test_bad_int_value(self):
247247 """Accessor raises TypeError if the state type mismatches expected int."""
248248 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
249249 with pytest .raises (TypeError ):
250- assert state .value_as_int
250+ _ = state .value_as_int
251251
252252 def test_float_value (self ):
253253 """Float typed state returns proper float accessor."""
@@ -258,7 +258,7 @@ def test_bad_float_value(self):
258258 """Accessor raises TypeError if the state type mismatches expected float."""
259259 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
260260 with pytest .raises (TypeError ):
261- assert state .value_as_float
261+ _ = state .value_as_float
262262
263263 def test_bool_value (self ):
264264 """Boolean typed state returns proper boolean accessor."""
@@ -269,7 +269,7 @@ def test_bad_bool_value(self):
269269 """Accessor raises TypeError if the state type mismatches expected bool."""
270270 state = State (name = "state" , type = DataType .INTEGER , value = 1 )
271271 with pytest .raises (TypeError ):
272- assert state .value_as_bool
272+ _ = state .value_as_bool
273273
274274 def test_str_value (self ):
275275 """String typed state returns proper string accessor."""
@@ -280,7 +280,7 @@ def test_bad_str_value(self):
280280 """Accessor raises TypeError if the state type mismatches expected string."""
281281 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
282282 with pytest .raises (TypeError ):
283- assert state .value_as_str
283+ _ = state .value_as_str
284284
285285 def test_dict_value (self ):
286286 """JSON object typed state returns proper dict accessor."""
@@ -291,7 +291,7 @@ def test_bad_dict_value(self):
291291 """Accessor raises TypeError if the state type mismatches expected dict."""
292292 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
293293 with pytest .raises (TypeError ):
294- assert state .value_as_dict
294+ _ = state .value_as_dict
295295
296296 def test_list_value (self ):
297297 """JSON array typed state returns proper list accessor."""
@@ -302,4 +302,4 @@ def test_bad_list_value(self):
302302 """Accessor raises TypeError if the state type mismatches expected list."""
303303 state = State (name = "state" , type = DataType .BOOLEAN , value = False )
304304 with pytest .raises (TypeError ):
305- assert state .value_as_list
305+ _ = state .value_as_list
0 commit comments