#NEWLINE# def test_config_yaml_alias_anchor( self ) : #NEWLINE# #INDENT# "Test the usage of YAML aliases and anchors.\n\n        The following test scene configuration is equivalent to:\n\n        scene:\n          - name: test\n            entities:\n              light_1: &light_1_state\n                state: 'on'\n                brightness: 100\n              light_2: *light_1_state\n\n        When encountering a YAML alias/anchor, the PyYAML parser will use a\n        reference to the original dictionary, instead of creating a copy, so\n        care needs to be taken to not modify the original.\n        " #NEWLINE# test_light = loader . get_component ( 'light.test' ) #NEWLINE# test_light . init ( ) #NEWLINE# self . assertTrue ( light . setup ( self . hass , { #NEWLINE# #INDENT# light . DOMAIN : { #NEWLINE# #INDENT# 'platform' : 'test' , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# ( light_1 , light_2 ) = test_light . DEVICES [ 0 : 2 ] #NEWLINE# light . turn_off ( self . hass , [ light_1 . entity_id , light_2 . entity_id ] ) #NEWLINE# self . hass . pool . block_till_done ( ) #NEWLINE# entity_state = { #NEWLINE# #INDENT# 'state' : 'on' , #NEWLINE# 'brightness' : 100 , #NEWLINE# #UNINDENT# } #NEWLINE# self . assertTrue ( scene . setup ( self . hass , { #NEWLINE# #INDENT# 'scene' : [ { #NEWLINE# #INDENT# 'name' : 'test' , #NEWLINE# 'entities' : { #NEWLINE# #INDENT# light_1 . entity_id : entity_state , #NEWLINE# test_light . entity_id : entity_state , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } ] , #NEWLINE# #UNINDENT# } ) ) #NEWLINE# scene . activate ( self . hass , 'scene.test' ) #NEWLINE# self . hass . pool . block_till_done ( ) #NEWLINE# self . assertTrue ( light_1 . is_on ) #NEWLINE# self . assertTrue ( light_2 . is_on ) #NEWLINE# self . assertEqual ( 100 , light_1 . last_call ( 'turn_on' ) [ 1 ] . get ( 'brightness' ) ) #NEWLINE# self . assertEqual ( 100 , light_2 . last_call ( 'turn_on' ) [ 1 ] . get ( 'brightness' ) )