diff --git a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py index e047d47290f..604c6bb779d 100644 --- a/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py +++ b/src/azure-cli/azure/cli/command_modules/synapse/tests/latest/test_synapse_scenario.py @@ -876,7 +876,9 @@ def _create_storage_account(self): @ResourceGroupPreparer(name_prefix='synapse-cli', random_name_length=16) def test_linked_service(self): self.kwargs.update({ - 'name': 'linkedservice'}) + 'name': 'linkedservice', + 'file': os.path.join(os.path.join(os.path.dirname(__file__), 'assets'), 'linkedservice.json') + }) # create a workspace self._create_workspace() @@ -892,7 +894,7 @@ def test_linked_service(self): # create linked service self.cmd( - 'az synapse linked-service create --workspace-name {workspace} --name {name} --file @src/azure-cli/azure/cli/command_modules/synapse/tests/latest/assets/linkedservice.json', + 'az synapse linked-service create --workspace-name {workspace} --name {name} --file @"{file}"', checks=[ self.check('name', self.kwargs['name']) ]) @@ -972,11 +974,13 @@ def test_dataset(self): def test_pipeline(self): self.kwargs.update({ 'workspace': 'testsynapseworkspace', - 'name': 'pipeline'}) + 'name': 'pipeline', + 'file': os.path.join(os.path.join(os.path.dirname(__file__), 'assets'), 'pipeline.json') + }) # create pipeline self.cmd( - 'az synapse pipeline create --workspace-name {workspace} --name {name} --file @src/azure-cli/azure/cli/command_modules/synapse/tests/latest/assets/pipeline.json', + 'az synapse pipeline create --workspace-name {workspace} --name {name} --file @"{file}"', checks=[ self.check('name', self.kwargs['name']) ]) @@ -1037,11 +1041,13 @@ def test_trigger(self): 'name': 'trigger', 'event-trigger': 'EventTrigger', 'tumbling-window-trigger': 'TumblingWindowTrigger', - 'run-id': '08586024051698130326966471413CU40'}) + 'run-id': '08586024051698130326966471413CU40', + 'file': os.path.join(os.path.join(os.path.dirname(__file__), 'assets'), 'trigger.json') + }) # create trigger self.cmd( - 'az synapse trigger create --workspace-name {workspace} --name {name} --file @src/azure-cli/azure/cli/command_modules/synapse/tests/latest/assets/trigger.json', + 'az synapse trigger create --workspace-name {workspace} --name {name} --file @"{file}"', checks=[ self.check('name', self.kwargs['name']) ]) @@ -1112,11 +1118,13 @@ def test_trigger(self): def test_data_flow(self): self.kwargs.update({ 'workspace': 'testsynapseworkspace', - 'name': 'dataflow'}) + 'name': 'dataflow', + 'file': os.path.join(os.path.join(os.path.dirname(__file__), 'assets'), 'dataflow.json') + }) # create data flow self.cmd( - 'az synapse data-flow create --workspace-name {workspace} --name {name} --file @src/azure-cli/azure/cli/command_modules/synapse/tests/latest/assets/dataflow.json', + 'az synapse data-flow create --workspace-name {workspace} --name {name} --file @"{file}"', checks=[ self.check('name', self.kwargs['name']) ]) @@ -1147,11 +1155,13 @@ def test_notebook(self): self.kwargs.update({ 'workspace': 'testsynapseworkspace', 'name': 'notebook', - 'spark-pool': 'testpool'}) + 'spark-pool': 'testpool', + 'file': os.path.join(os.path.join(os.path.dirname(__file__), 'assets'), 'notebook.ipynb') + }) # create notebook self.cmd( - 'az synapse notebook create --workspace-name {workspace} --name {name} --file @src/azure-cli/azure/cli/command_modules/synapse/tests/latest/assets/notebook.ipynb ' + 'az synapse notebook create --workspace-name {workspace} --name {name} --file @"{file}" ' '--spark-pool-name {spark-pool}', checks=[ self.check('name', self.kwargs['name'])