File tree Expand file tree Collapse file tree
tests/unit/load_balancers Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313 LoadBalancerHealthCheck ,
1414 LoadBalancersClient ,
1515 LoadBalancerService ,
16+ LoadBalancerServiceHttp ,
1617 LoadBalancerTarget ,
1718 LoadBalancerTargetIP ,
1819 LoadBalancerTargetLabelSelector ,
@@ -383,13 +384,38 @@ def test_add_service(
383384 ):
384385 request_mock .return_value = response_add_service
385386
386- service = LoadBalancerService (listen_port = 80 , protocol = "http" )
387+ service = LoadBalancerService (
388+ listen_port = 80 ,
389+ protocol = "http" ,
390+ destination_port = 8080 ,
391+ proxyprotocol = False ,
392+ http = LoadBalancerServiceHttp (
393+ cookie_name = "HCLBSTICKY" ,
394+ cookie_lifetime = 300 ,
395+ redirect_http = True ,
396+ sticky_sessions = True ,
397+ timeout_idle = 60 ,
398+ ),
399+ )
387400 action = resource_client .add_service (load_balancer , service )
388401
389402 request_mock .assert_called_with (
390403 method = "POST" ,
391404 url = "/load_balancers/1/actions/add_service" ,
392- json = {"protocol" : "http" , "listen_port" : 80 },
405+ json = {
406+ "protocol" : "http" ,
407+ "listen_port" : 80 ,
408+ "destination_port" : 8080 ,
409+ "proxyprotocol" : False ,
410+ "http" : {
411+ "cookie_name" : "HCLBSTICKY" ,
412+ "cookie_lifetime" : 300 ,
413+ "redirect_http" : True ,
414+ "sticky_sessions" : True ,
415+ "timeout_idle" : 60 ,
416+ "certificates" : [],
417+ },
418+ },
393419 )
394420
395421 assert action .id == 13
You can’t perform that action at this time.
0 commit comments