Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to Dyson 360 Eye robot vacuum using new vacuum platform #8852

Merged
merged 5 commits into from
Aug 6, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix tests with Python 3.5
  • Loading branch information
CharlesBlonde committed Aug 5, 2017
commit e98bf0fcdb1453ef95153fdbaec6fed4e07fa624
20 changes: 10 additions & 10 deletions tests/components/vacuum/test_dyson.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def _get_vacuum_device_charging():

def _get_vacuum_device_pause():
"""Return a vacuum device in pause."""
device = mock.Mock(spec=Dyson360Eye)
device = mock.MagicMock(spec=Dyson360Eye)
device.name = "Device_Vacuum"
device.state = mock.MagicMock()
device.state.state = Dyson360EyeMode.FULL_CLEAN_PAUSED
Expand Down Expand Up @@ -99,7 +99,7 @@ def test_on_message(self):
component.entity_id = "entity_id"
component.schedule_update_ha_state = mock.Mock()
component.on_message(mock.Mock())
component.schedule_update_ha_state.assert_called()
self.assertTrue(component.schedule_update_ha_state.called)

def test_should_poll(self):
"""Test polling is disable."""
Expand Down Expand Up @@ -135,26 +135,26 @@ def test_turn_on(self):
device1 = _get_vacuum_device_charging()
component1 = Dyson360EyeDevice(self.hass, device1)
component1.turn_on()
device1.start.assert_called()
self.assertTrue(device1.start.called)

device2 = _get_vacuum_device_pause()
component2 = Dyson360EyeDevice(self.hass, device2)
component2.turn_on()
device2.resume.assert_called()
self.assertTrue(device2.resume.called)

def test_turn_off(self):
"""Test turn off vacuum."""
device1 = _get_vacuum_device_cleaning()
component1 = Dyson360EyeDevice(self.hass, device1)
component1.turn_off()
device1.pause.assert_called()
self.assertTrue(device1.pause.called)

def test_stop(self):
"""Test stop vacuum."""
device1 = _get_vacuum_device_cleaning()
component1 = Dyson360EyeDevice(self.hass, device1)
component1.stop()
device1.pause.assert_called()
self.assertTrue(device1.pause.called)

def test_set_fan_speed(self):
"""Test set fan speed vacuum."""
Expand All @@ -168,21 +168,21 @@ def test_start_pause(self):
device1 = _get_vacuum_device_charging()
component1 = Dyson360EyeDevice(self.hass, device1)
component1.start_pause()
device1.start.assert_called()
self.assertTrue(device1.start.called)

device2 = _get_vacuum_device_pause()
component2 = Dyson360EyeDevice(self.hass, device2)
component2.start_pause()
device2.resume.assert_called()
self.assertTrue(device2.resume.called)

device3 = _get_vacuum_device_cleaning()
component3 = Dyson360EyeDevice(self.hass, device3)
component3.start_pause()
device3.pause.assert_called()
self.assertTrue(device3.pause.called)

def test_return_to_base(self):
"""Test return to base."""
device = _get_vacuum_device_pause()
component = Dyson360EyeDevice(self.hass, device)
component.return_to_base()
device.abort.assert_called()
self.assertTrue(device.abort.called)