'Test Python API set_state with push option.'

def test_set_state_with_push(self):

    events = []
    hass.bus.listen(EVENT_STATE_CHANGED, (lambda ev: events.append(ev)))
    remote.set_state(master_api, 'test.test', 'set_test_2')
    remote.set_state(master_api, 'test.test', 'set_test_2')
    hass.block_till_done()
    self.assertEqual(1, len(events))
    remote.set_state(master_api, 'test.test', 'set_test_2', force_update=True)
    hass.block_till_done()
    self.assertEqual(2, len(events))
