1+ import base64
12import logging
23import re
34from unittest .mock import create_autospec
@@ -254,7 +255,9 @@ def test_validate_storage_credentials_failed_operation(credential_manager):
254255
255256@pytest .fixture
256257def sp_migration (ws , installation , credential_manager ):
257- ws .secrets .get_secret .return_value = GetSecretResponse (value = "aGVsbG8gd29ybGQ=" )
258+ ws .secrets .get_secret .return_value = GetSecretResponse (
259+ value = base64 .b64encode ("hello world" .encode ("utf-8" )).decode ("utf-8" )
260+ )
258261
259262 arp = AzureResourcePermissions (
260263 installation , ws , create_autospec (AzureResources ), create_autospec (ExternalLocations )
@@ -288,7 +291,10 @@ def test_for_cli(ws, installation):
288291
289292@pytest .mark .parametrize (
290293 "secret_bytes_value, num_migrated" ,
291- [(GetSecretResponse (value = "aGVsbG8gd29ybGQ=" ), 1 ), (GetSecretResponse (value = "T2zhLCBNdW5kbyE=" ), 0 )],
294+ [
295+ (GetSecretResponse (value = base64 .b64encode ("hello world" .encode ("utf-8" )).decode ("utf-8" )), 1 ),
296+ (GetSecretResponse (value = base64 .b64encode ("Olá, Mundo" .encode ("iso-8859-1" )).decode ("iso-8859-1" )), 0 ),
297+ ],
292298)
293299def test_read_secret_value_decode (ws , sp_migration , secret_bytes_value , num_migrated ):
294300 ws .secrets .get_secret .return_value = secret_bytes_value
@@ -316,7 +322,9 @@ def test_read_secret_read_exception(caplog, ws, sp_migration):
316322
317323def test_print_action_plan (caplog , ws , sp_migration ):
318324 caplog .set_level (logging .INFO )
319- ws .secrets .get_secret .return_value = GetSecretResponse (value = "aGVsbG8gd29ybGQ=" )
325+ ws .secrets .get_secret .return_value = GetSecretResponse (
326+ value = base64 .b64encode ("hello world" .encode ("utf-8" )).decode ("utf-8" )
327+ )
320328
321329 prompts = MockPrompts ({"Above Azure Service Principals will be migrated to UC storage credentials*" : "Yes" })
322330
@@ -331,7 +339,9 @@ def test_print_action_plan(caplog, ws, sp_migration):
331339
332340
333341def test_run_without_confirmation (ws , sp_migration ):
334- ws .secrets .get_secret .return_value = GetSecretResponse (value = "aGVsbG8gd29ybGQ=" )
342+ ws .secrets .get_secret .return_value = GetSecretResponse (
343+ value = base64 .b64encode ("hello world" .encode ("utf-8" )).decode ("utf-8" )
344+ )
335345 prompts = MockPrompts (
336346 {
337347 "Above Azure Service Principals will be migrated to UC storage credentials*" : "No" ,
0 commit comments