'Test the subscription.'

def test_subscribe(self):

    fake_hass = mock.MagicMock()
    gf = graphite.GraphiteFeeder(fake_hass, 'foo', 123, 'ha')
    fake_hass.bus.listen_once.has_calls([mock.call(EVENT_HOMEASSISTANT_START, gf.start_listen), mock.call(EVENT_HOMEASSISTANT_STOP, gf.shutdown)])
    self.assertEqual(fake_hass.bus.listen.call_count, 1)
    self.assertEqual(fake_hass.bus.listen.call_args, mock.call(EVENT_STATE_CHANGED, gf.event_listener))
