'Setup and scan a picture and test faces from event.'

def test_face_event_call(self, aioclient_mock):

    aioclient_mock.get(self.url, content='image')
    ip.scan(self.hass, entity_id='image_processing.demo_face')
    self.hass.block_till_done()
    state = self.hass.states.get('image_processing.demo_face')
    assert (len(self.face_events) == 2)
    assert (state.state == 'Hans')
    assert (state.attributes['total_faces'] == 4)
    event_data = [event.data for event in self.face_events if (event.data.get('name') == 'Hans')]
    assert (len(event_data) == 1)
    assert (event_data[0]['name'] == 'Hans')
    assert (event_data[0]['confidence'] == 98.34)
    assert (event_data[0]['gender'] == 'male')
    assert (event_data[0]['entity_id'] == 'image_processing.demo_face')
