'Test if entity ids helper method works.'

def test_entity_ids(self):

    run = RecorderRuns(start=datetime(2016, 7, 9, 11, 0, 0, tzinfo=dt.UTC), end=datetime(2016, 7, 9, 23, 0, 0, tzinfo=dt.UTC), closed_incorrect=False, created=datetime(2016, 7, 9, 11, 0, 0, tzinfo=dt.UTC))
    self.session.add(run)
    self.session.commit()
    before_run = datetime(2016, 7, 9, 8, 0, 0, tzinfo=dt.UTC)
    in_run = datetime(2016, 7, 9, 13, 0, 0, tzinfo=dt.UTC)
    in_run2 = datetime(2016, 7, 9, 15, 0, 0, tzinfo=dt.UTC)
    in_run3 = datetime(2016, 7, 9, 18, 0, 0, tzinfo=dt.UTC)
    after_run = datetime(2016, 7, 9, 23, 30, 0, tzinfo=dt.UTC)
    assert (run.to_native() == run)
    assert (run.entity_ids() == [])
    self.session.add(States(entity_id='sensor.temperature', state='20', last_changed=before_run, last_updated=before_run))
    self.session.add(States(entity_id='sensor.sound', state='10', last_changed=after_run, last_updated=after_run))
    self.session.add(States(entity_id='sensor.humidity', state='76', last_changed=in_run, last_updated=in_run))
    self.session.add(States(entity_id='sensor.lux', state='5', last_changed=in_run3, last_updated=in_run3))
    assert (sorted(run.entity_ids()) == ['sensor.humidity', 'sensor.lux'])
    assert (run.entity_ids(in_run2) == ['sensor.humidity'])
