def test_is_state_attr(self):
        self.hass.states.set('test.object', 'available', {'mode': 'on'})
        self.assertEqual(
            'yes',
            template.render(
                self.hass,
                """
{% if is_state_attr("test.object", "mode", "on") %}yes{% else %}no{% endif %}
                """))
.
dataset/ETHPy150Open home-assistant/home-assistant/tests/helpers/test_template.py/TestUtilTemplate.test_is_state_attr