Skip to content

Commit

Permalink
Fixing test errors : nabweatherd/tests/nabweatherd_test.py:74: Assert…
Browse files Browse the repository at this point in the history
…ionError and nabweatherd/tests/nabweatherd_test.py:56: AssertionError
  • Loading branch information
Olivier committed Jun 17, 2020
1 parent 6da7eb5 commit dd9ff81
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nabweatherd/nabweatherd.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def normalize_weather_class(self, weather_class):

def get_animation(self, info_data):

if (info_data == None):
if (info_data is None):
return

logging.debug(f"get_animation :{info_data['weather_animation_type']}")
Expand Down
3 changes: 1 addition & 2 deletions nabweatherd/tests/nabweatherd_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ def test_perform(self):
packet_json = json.loads(packet.decode("utf8"))
self.assertEqual(packet_json["type"], "info")
self.assertEqual(packet_json["info_id"], "nabweatherd_rain")
self.assertTrue("animation" in packet_json)
packet = writer.written[1]
packet_json = json.loads(packet.decode("utf8"))
self.assertEqual(packet_json["type"], "message")
Expand All @@ -71,7 +70,7 @@ def test_asr(self):
service.writer = writer
packet = {"type": "asr_event", "nlu": {"intent": "nabweatherd/forecast"}}
async_to_sync(service.process_nabd_packet)(packet)
self.assertEqual(len(writer.written), 2)
self.assertEqual(len(writer.written), 3)
packet = writer.written[0]
packet_json = json.loads(packet.decode("utf8"))
self.assertEqual(packet_json["type"], "info")
Expand Down

0 comments on commit dd9ff81

Please sign in to comment.