Пример #1
0
 def test_create_no_file_throw_exception(
         self, mock_endpoint_operations: EndpointOperations,
         randstr: str) -> None:
     with pytest.raises(Exception):
         mock_endpoint_operations.create(type=ONLINE_ENDPOINT_TYPE,
                                         name=randstr,
                                         file=None)
Пример #2
0
 def test_online_create(
     self,
     mock_endpoint_operations: EndpointOperations,
     randstr: str,
     create_yaml_happy_path: str,
     mocker: MockFixture,
 ) -> None:
     mocker.patch(
         "azure.ml._operations.endpoint_operations.OperationOrchestrator.get_code_asset_arm_id",
         return_value="xxx")
     mocker.patch(
         "azure.ml._operations.endpoint_operations.OperationOrchestrator.get_environment_arm_id",
         return_value="xxx")
     mocker.patch(
         "azure.ml._operations.endpoint_operations.OperationOrchestrator.get_model_arm_id",
         return_value="xxx")
     mocker.patch(
         "azure.ml._operations.endpoint_operations.EndpointOperations._get_workspace_location",
         return_value="xxx")
     mocker.patch(
         "azure.ml._operations.endpoint_operations.OnlineEndpointArmGenerator.generate_online_endpoint_template",
         return_value=("xxx", []),
     )
     mocker.patch(
         "azure.ml._operations.endpoint_operations.ArmDeploymentExecutor.deploy_resource",
         return_value="xxx")
     mock_endpoint_operations._credentials = Mock(
         spec_set=DefaultAzureCredential)
     mock_endpoint_operations.create(type=ONLINE_ENDPOINT_TYPE,
                                     name=randstr,
                                     file=create_yaml_happy_path)
Пример #3
0
 def test_create_no_type_in_file_throw_exception(
         self, mock_endpoint_operations: EndpointOperations, randstr: str,
         create_yaml_no_type) -> None:
     with pytest.raises(Exception):
         mock_endpoint_operations.create(name=randstr, file=None)