'Test if methods call the services as expected.'

def test_methods(self):

    self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_ON)
    self.hass.block_till_done()
    self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC))
    self.hass.states.set(ENTITY_VACUUM_BASIC, STATE_OFF)
    self.hass.block_till_done()
    self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_BASIC))
    self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_ON)
    self.hass.block_till_done()
    self.assertTrue(vacuum.is_on(self.hass))
    self.hass.states.set(ENTITY_ID_ALL_VACUUMS, STATE_OFF)
    self.hass.block_till_done()
    self.assertFalse(vacuum.is_on(self.hass))
    vacuum.turn_on(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    vacuum.turn_off(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    vacuum.toggle(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    vacuum.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    vacuum.start_pause(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertTrue(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    vacuum.stop(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    self.assertFalse(vacuum.is_on(self.hass, ENTITY_VACUUM_COMPLETE))
    state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertLess(state.attributes.get(ATTR_BATTERY_LEVEL), 100)
    self.assertNotEqual('Charging', state.attributes.get(ATTR_STATUS))
    vacuum.locate(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertIn("I'm    over    here", state.attributes.get(ATTR_STATUS))
    vacuum.return_to_base(self.hass, ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertIn('Returning    home', state.attributes.get(ATTR_STATUS))
    vacuum.set_fan_speed(self.hass, FAN_SPEEDS[(-1)], entity_id=ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertEqual(FAN_SPEEDS[(-1)], state.attributes.get(ATTR_FAN_SPEED))
    vacuum.clean_spot(self.hass, entity_id=ENTITY_VACUUM_COMPLETE)
    self.hass.block_till_done()
    state = self.hass.states.get(ENTITY_VACUUM_COMPLETE)
    self.assertIn('spot', state.attributes.get(ATTR_STATUS))
    self.assertEqual(STATE_ON, state.state)
