def test_warning_config_google_home_listen_port():
 with patch.object(_LOGGER, 'warning') as mock_warn:
  Config(None, {'type': 'google_home', 'host_ip': '123.123.123.123', 'listen_port': 8300})
  assert mock_warn.called
  assert (mock_warn.mock_calls[0][1][0] == 'When targetting Google Home, listening port has to be port 80')

def test_warning_config_google_home_listen_port ( ) : with patch . object ( _LOGGER , 'warning' ) as mock_warn : Config ( None , { 'type' : 'google_home' , 'host_ip' : '123.123.123.123' , 'listen_port' : 8300 } ) assert mock_warn . called assert ( mock_warn . mock_calls [ 0 ] [ 1 ] [ 0 ] == 'When targetting Google Home, listening port has to be port 80' )
test we warn when non-default port is used for google home .