@@ -1531,29 +1531,27 @@ def test_lb_update_disabled(self, refresh_vips):
1531
1531
@mock .patch .object (ovn_helper .OvnProviderHelper , '_refresh_lb_vips' )
1532
1532
def test_lb_update_enabled (self , refresh_vips ):
1533
1533
# Change the mock, its enabled by default.
1534
- self .ovn_lb .external_ids .update ({'enabled' : False })
1535
- self .lb ['admin_state_up' ] = True
1534
+ self .lb [constants .ADMIN_STATE_UP ] = False
1536
1535
status = self .helper .lb_update (self .lb )
1537
1536
self .assertEqual (status ['loadbalancers' ][0 ]['provisioning_status' ],
1538
1537
constants .ACTIVE )
1539
1538
self .assertEqual (status ['loadbalancers' ][0 ]['operating_status' ],
1540
- constants .ONLINE )
1539
+ constants .OFFLINE )
1541
1540
refresh_vips .assert_called_once_with (
1542
1541
self .ovn_lb , self .ovn_lb .external_ids )
1543
1542
self .helper .ovn_nbdb_api .db_set .assert_called_once_with (
1544
1543
'Load_Balancer' , self .ovn_lb .uuid ,
1545
- ('external_ids' , {'enabled' : 'True ' }))
1544
+ ('external_ids' , {'enabled' : 'False ' }))
1546
1545
# update to re-enable
1547
- self .ovn_lb .external_ids .update ({'enabled' : True })
1548
- self .lb ['admin_state_up' ] = True
1546
+ self .lb [constants .ADMIN_STATE_UP ] = True
1549
1547
status = self .helper .lb_update (self .lb )
1550
1548
self .assertEqual (status ['loadbalancers' ][0 ]['provisioning_status' ],
1551
1549
constants .ACTIVE )
1552
1550
self .assertEqual (status ['loadbalancers' ][0 ]['operating_status' ],
1553
1551
constants .ONLINE )
1554
- refresh_vips .assert_called_once_with (
1552
+ refresh_vips .assert_called_with (
1555
1553
self .ovn_lb , self .ovn_lb .external_ids )
1556
- self .helper .ovn_nbdb_api .db_set .assert_called_once_with (
1554
+ self .helper .ovn_nbdb_api .db_set .assert_called_with (
1557
1555
'Load_Balancer' , self .ovn_lb .uuid ,
1558
1556
('external_ids' , {'enabled' : 'True' }))
1559
1557
0 commit comments