#NEWLINE# def test_config_haproxy_group_fallback( self ) : #NEWLINE# #INDENT# apps = dict ( ) #NEWLINE# groups = [ 'external' ] #NEWLINE# bind_http_https = True #NEWLINE# ssl_certs = '' #NEWLINE# templater = marathon_lb . ConfigTemplater ( ) #NEWLINE# healthCheck = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# app1 = marathon_lb . MarathonService ( '/nginx' , 10000 , healthCheck ) #NEWLINE# app1 . groups = [ 'external' , 'internal' ] #NEWLINE# app1 . add_backend ( 'agent1' , '1.1.1.1' , 1024 , False ) #NEWLINE# app2 = marathon_lb . MarathonService ( '/nginx' , 10001 , healthCheck ) #NEWLINE# app2 . groups = [ 'external' , 'internal' ] #NEWLINE# app2 . add_backend ( 'agent1' , '1.1.1.1' , 1025 , False ) #NEWLINE# apps = [ app1 , app2 ] #NEWLINE# config = marathon_lb . config ( apps , groups , bind_http_https , ssl_certs , templater ) #NEWLINE# expected = ( self . base_config + '\nfrontend marathon_http_in\n  bind *:80\n  mode http\n\nfrontend marathon_http_appid_in\n  bind *:9091\n  mode http\n\nfrontend marathon_https_in\n  bind *:443 ssl crt /etc/ssl/mesosphere.com.pem\n  mode http\n\nfrontend nginx_10000\n  bind *:10000\n  mode tcp\n  use_backend nginx_10000\n\nfrontend nginx_10001\n  bind *:10001\n  mode tcp\n  use_backend nginx_10001\n\nbackend nginx_10000\n  balance roundrobin\n  mode tcp\n  server agent1_1_1_1_1_1024 1.1.1.1:1024\n\nbackend nginx_10001\n  balance roundrobin\n  mode tcp\n  server agent1_1_1_1_1_1025 1.1.1.1:1025\n' ) #NEWLINE# self . assertMultiLineEqual ( config , expected )