def test_if_state_exists(self):
        self.hass.states.set('test.object', 'available')
        self.assertEqual(
            'exists',
            template.render(
                self.hass,
                """
{% if states.test.object %}exists{% else %}not exists{% endif %}
                """))
.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_template.py/TestUtilTemplate.test_if_state_exists