55# or in the "LICENSE.txt" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES
66# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions and
77# limitations under the License.
8+ import re
9+
810import pytest
911from assertpy import assert_that
1012
@@ -24,8 +26,8 @@ def test_helper(self, test_datadir, run_cli, assert_out_err):
2426 (["--cluster-name" , "cluster" , "--invalid" ], "Invalid arguments ['--invalid']" ),
2527 (
2628 ["--cluster-name" , "cluster" , "--node-type" , "invalid" ],
27- "error: argument --node-type: invalid choice: 'invalid' (choose from ' HeadNode', ' ComputeNode' , "
28- "' LoginNode' )" ,
29+ r "error: argument --node-type: invalid choice: 'invalid' \ (choose from .* HeadNode.*, .* ComputeNode.* , "
30+ r".* LoginNode.*\ )" ,
2931 ),
3032 (
3133 ["--cluster-name" , "cluster" , "--region" , "eu-west-" ],
@@ -38,4 +40,4 @@ def test_invalid_args(self, args, error_message, run_cli, capsys):
3840 run_cli (command , expect_failure = True )
3941
4042 out , err = capsys .readouterr ()
41- assert_that (out + err ). contains ( error_message )
43+ assert_that (re . search ( error_message , out + err ) or error_message in out + err ). is_true ( )
0 commit comments