@@ -62,7 +62,8 @@ async def test_build_porter_command(mock_get_porter_parameter_keys):
6262 commands , param_set_file , param_set_name = await build_porter_command (config , msg_body )
6363 try :
6464 assert param_set_file is not None
65- assert param_set_name == "tre-params-guid"
65+ assert param_set_name .startswith ("tre-params-guid-" )
66+ assert len (param_set_name ) == len ("tre-params-guid-" ) + 8
6667 assert os .path .exists (param_set_file )
6768
6869 # First command applies the parameter set to Porter's store
@@ -72,7 +73,7 @@ async def test_build_porter_command(mock_get_porter_parameter_keys):
7273 assert commands [1 ] == [
7374 "porter" , "install" , "guid" ,
7475 "--reference" , "myregistry.azurecr.io/mybundle:v1.0.0" ,
75- "--parameter-set" , "tre-params-guid" ,
76+ "--parameter-set" , param_set_name ,
7677 "--force" ,
7778 "--credential-set" , "arm_auth" ,
7879 "--credential-set" , "aad_auth"
@@ -82,7 +83,7 @@ async def test_build_porter_command(mock_get_porter_parameter_keys):
8283 param_set = json .load (f )
8384
8485 assert param_set ["schemaType" ] == "ParameterSet"
85- assert param_set ["name" ] == "tre-params-guid"
86+ assert param_set ["name" ] == param_set_name
8687 assert len (param_set ["parameters" ]) == 1
8788 assert param_set ["parameters" ][0 ] == {"name" : "param1" , "source" : {"value" : "value1" }}
8889 finally :
@@ -100,7 +101,7 @@ async def test_build_porter_command_for_upgrade(mock_get_porter_parameter_keys):
100101 commands , param_set_file , param_set_name = await build_porter_command (config , msg_body )
101102 try :
102103 assert param_set_file is not None
103- assert param_set_name == "tre-params-guid"
104+ assert param_set_name . startswith ( "tre-params-guid-" )
104105 assert os .path .exists (param_set_file )
105106
106107 # First command applies the parameter set to Porter's store
@@ -110,7 +111,7 @@ async def test_build_porter_command_for_upgrade(mock_get_porter_parameter_keys):
110111 assert commands [1 ] == [
111112 "porter" , "upgrade" , "guid" ,
112113 "--reference" , "myregistry.azurecr.io/mybundle:v1.0.0" ,
113- "--parameter-set" , "tre-params-guid" ,
114+ "--parameter-set" , param_set_name ,
114115 "--force" ,
115116 "--credential-set" , "arm_auth" ,
116117 "--credential-set" , "aad_auth" ,
@@ -145,7 +146,7 @@ async def test_build_porter_command_no_parameters(mock_get_porter_parameter_keys
145146 commands , param_set_file , param_set_name = await build_porter_command (config , msg_body )
146147
147148 assert param_set_file is None
148- assert param_set_name == "tre-params-guid"
149+ assert param_set_name . startswith ( "tre-params-guid-" )
149150 assert commands == [[
150151 "porter" , "install" , "guid" ,
151152 "--reference" , "myregistry.azurecr.io/mybundle:v1.0.0" ,
@@ -185,7 +186,8 @@ async def test_build_porter_command_with_complex_parameters(mock_get_porter_para
185186 # Main porter command should reference the parameter set by name
186187 main_command = commands [1 ]
187188 assert "--parameter-set" in main_command
188- assert "tre-params-guid" in main_command
189+ assert param_set_name in main_command
190+ assert param_set_name .startswith ("tre-params-guid-" )
189191 assert "--param" not in main_command
190192
191193 # Verify the param set file contains the correct parameters
0 commit comments