<s> """<STR_LIT>""" <EOL> import unittest <EOL> import homeassistant . components . garage_door as gd <EOL> from tests . common import get_test_home_assistant <EOL> LEFT = '<STR_LIT>' <EOL> RIGHT = '<STR_LIT>' <EOL> class TestGarageDoorDemo ( unittest . TestCase ) : <EOL> """<STR_LIT>""" <EOL> def setUp ( self ) : <EOL> """<STR_LIT>""" <EOL> self . hass = get_test_home_assistant ( ) <EOL> self . assertTrue ( gd . setup ( self . hass , { <EOL> '<STR_LIT>' : { <EOL> '<STR_LIT>' : '<STR_LIT>' <EOL> } <EOL> } ) ) <EOL> def tearDown ( self ) : <EOL> """<STR_LIT>""" <EOL> self . hass . stop ( ) <EOL> def test_is_closed ( self ) : <EOL> """<STR_LIT>""" <EOL> self . assertTrue ( gd . is_closed ( self . hass , LEFT ) ) <EOL> self . hass . states . is_state ( LEFT , '<STR_LIT>' ) <EOL> self . assertFalse ( gd . is_closed ( self . hass , RIGHT ) ) <EOL> self . hass . states . is_state ( RIGHT , '<STR_LIT>' ) <EOL> def test_open_door ( self ) : <EOL> """<STR_LIT>""" <EOL> gd . open_door ( self . hass , LEFT ) <EOL> self . hass . pool . block_till_done ( ) <EOL> self . assertFalse ( gd . is_closed ( self . hass , LEFT ) ) <EOL> def test_close_door ( self ) : <EOL> """<STR_LIT>""" <EOL> gd . close_door ( self . hass , RIGHT ) <EOL> self . hass . pool . block_till_done ( ) <EOL> self . assertTrue ( gd . is_closed ( self . hass , RIGHT ) ) </s>
