Skip to content

Commit

Permalink
{ARM} az bicep: Change tests to live only mode (#27288)
Browse files Browse the repository at this point in the history
  • Loading branch information
yanzhudd authored Aug 31, 2023
1 parent 95e9f60 commit 4e21baa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4991,7 +4991,7 @@ def test_bicep_list_versions(self):
self.greater_than('length(@)', 0)
])

class BicepDecompileParamsTest(ScenarioTest):
class BicepDecompileParamsTest(LiveScenarioTest):
def setup(self):
super().setup()
self.cmd('az bicep uninstall')
Expand All @@ -5014,7 +5014,7 @@ def test_bicep_decompile_params_file(self):
if os.path.exists(params_path):
os.remove(params_path)

class BicepBuildParamsTest(ScenarioTest):
class BicepBuildParamsTest(LiveScenarioTest):
def setup(self):
super().setup()
self.cmd('az bicep uninstall')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
from azure.cli.core.commands import AzCliCommand
from azure.cli.core.profiles._shared import ResourceType

from azure.cli.testsdk import live_only

cli_ctx = DummyCli()
loader = AzCommandsLoader(cli_ctx, resource_type=ResourceType.MGMT_RESOURCE_RESOURCES)
cmd = AzCliCommand(loader, 'test', None)
Expand Down Expand Up @@ -365,6 +367,7 @@ def test_deployment_bicepparam_file_input_check(self):
self.assertEqual(_is_bicepparam_file_provided([['test.bicepparam']]), True)
self.assertEqual(_is_bicepparam_file_provided([['test.bicepparam'], ['test.json'], ['{ \"foo\": { \"value\": \"bar\" } }']]), True)

@live_only()
def test_bicep_generate_params_defaults(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
bicep_file = os.path.join(curr_dir, 'sample_params.bicep').replace('\\', '\\\\')
Expand All @@ -374,6 +377,7 @@ def test_bicep_generate_params_defaults(self):
is_generated_params_file_exists = os.path.exists(json_file)
self.assertTrue(is_generated_params_file_exists)

@live_only()
def test_bicep_generate_params_output_format(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
bicep_file = os.path.join(curr_dir, 'sample_params.bicep').replace('\\', '\\\\')
Expand All @@ -383,6 +387,7 @@ def test_bicep_generate_params_output_format(self):
is_generated_params_file_exists = os.path.exists(json_file)
self.assertTrue(is_generated_params_file_exists)

@live_only()
def test_bicep_generate_params_include_params(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
bicep_file = os.path.join(curr_dir, 'sample_params.bicep').replace('\\', '\\\\')
Expand All @@ -392,6 +397,7 @@ def test_bicep_generate_params_include_params(self):
is_generated_params_file_exists = os.path.exists(json_file)
self.assertTrue(is_generated_params_file_exists)

@live_only()
def test_bicep_build_params_defaults(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
param_file = os.path.join(curr_dir, 'sample_params.bicepparam').replace('\\', '\\\\')
Expand All @@ -402,6 +408,7 @@ def test_bicep_build_params_defaults(self):

self.assertTrue(is_generated_params_file_exists)

@live_only()
def test_bicep_decompile_params_defaults(self):
curr_dir = os.path.dirname(os.path.realpath(__file__))
param_file = os.path.join(curr_dir, 'param-validation-params.bicepparam').replace('\\', '\\\\')
Expand Down

0 comments on commit 4e21baa

Please sign in to comment.