'Test using states as a function.'

def test_states_function(self):

    self.hass.states.set('test.object', 'available')
    tpl = template.Template('{{    states("test.object")    }}', self.hass)
    self.assertEqual('available', tpl.render())
    tpl2 = template.Template('{{    states("test.object2")    }}', self.hass)
    self.assertEqual('unknown', tpl2.render())
