Skip to content

Commit eec11cf

Browse files
author
Joel Collins
committed
Fixed bad comparison tests
1 parent 06dcd1f commit eec11cf

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

labthings/server/view/builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ def _put(self, args):
5656
generated_class.post = _post
5757
generated_class.methods.add("POST")
5858
# Enable PUT requests for dictionaries
59-
if type(getattr(property_object, property_name)) == dict:
59+
if type(getattr(property_object, property_name)) is dict:
6060
generated_class.put = _put
6161
generated_class.methods.add("PUT")
6262

6363
# Add decorators for arguments etc
6464
initial_property_value = getattr(property_object, property_name)
65-
if type(initial_property_value) == dict:
65+
if type(initial_property_value) is dict:
6666
property_schema = data_dict_to_schema(initial_property_value)
6767
else:
6868
property_schema = value_to_field(initial_property_value)

tests/test_server_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ def test_make_primitive():
4141
assert types.make_primitive(numpy.array([1, 2, 3])) == [1, 2, 3]
4242
assert types.make_primitive(numpy.int16(10)) == 10
4343

44-
assert type(types.make_primitive(generic_object)) == str
44+
assert type(types.make_primitive(generic_object)) is str
4545
assert types.make_primitive(generic_object).startswith("<object object at ")
4646

4747
assert types.make_primitive(10) == 10

0 commit comments

Comments
 (0)