'Test reproduce_state with SERVICE_TURN_OFF.'

def test_reproduce_turn_off(self):

    calls = mock_service(self.hass, 'light', SERVICE_TURN_OFF)
    self.hass.states.set('light.test', 'on')
    state.reproduce_state(self.hass, ha.State('light.test', 'off'))
    self.hass.block_till_done()
    self.assertTrue((len(calls) > 0))
    last_call = calls[(-1)]
    self.assertEqual('light', last_call.domain)
    self.assertEqual(SERVICE_TURN_OFF, last_call.service)
    self.assertEqual(['light.test'], last_call.data.get('entity_id'))
