@@ -167,6 +167,17 @@ def test_update_session_state_kwargs(self, request, mgmt_root):
167167 n2 .session = n1 .session
168168 n2 .state = n1 .state
169169
170+ def test_update_session_without_state (self , request , mgmt_root ):
171+ n1 , nc1 = setup_node_test (
172+ request , mgmt_root , 'Common' , 'node1' , '192.168.100.2' )
173+ assert n1 .session == 'user-enabled'
174+ assert n1 .state == 'unchecked'
175+ n1 .update (session = 'user-disabled' )
176+ n2 = mgmt_root .tm .ltm .nodes .node .load (name = 'node1' , partition = 'Common' )
177+ n2 .session = 'user-disabled'
178+ n2 .session = n1 .session
179+ n2 .state = n1 .state
180+
170181 def test_state_modify (self , request , mgmt_root ):
171182 n1 , nc1 = setup_node_test (
172183 request , mgmt_root , 'Common' , 'node1' , '10.10.10.1' )
@@ -182,21 +193,14 @@ def test_state_modify_error(self, request, mgmt_root):
182193 request , mgmt_root , 'Common' , 'node1' , '10.10.10.1' )
183194 with pytest .raises (NodeStateModifyUnsupported ) as ex :
184195 n1 .modify (state = 'down' )
185- assert ex .value .message == "The node resource does not support a " \
186- "modify with the value of the 'state' " \
187- "attribute as down. The accepted values " \
188- "are 'user-up' or 'user-down'"
196+ assert "The node resource does not support a" in str (ex .value )
189197
190198 def test_session_modify_error (self , request , mgmt_root ):
191199 n1 , nc1 = setup_node_test (
192200 request , mgmt_root , 'Common' , 'node1' , '10.10.10.1' )
193201 with pytest .raises (NodeStateModifyUnsupported ) as ex :
194- n1 .modify (state = 'monitor-enabled' )
195- assert ex .value .message == "The node resource does not support a " \
196- "modify with the value of the 'state' " \
197- "attribute as monitor-enabled. " \
198- "The accepted values are " \
199- "'user-up' or 'user-down'"
202+ n1 .modify (session = 'monitor-enabled' )
203+ assert "The node resource does not support a" in str (ex .value )
200204
201205
202206class TestNodes (object ):
0 commit comments