1234567891011121314151617 |
- def test_configure_pool_with_latest_vm(self):
- with mock.patch(
- "airflow.providers.microsoft.azure.hooks."
- "batch.AzureBatchHook._get_latest_verified_image_vm_and_sku"
- ) as mock_getvm:
- hook = AzureBatchHook(azure_batch_conn_id=self.test_cloud_conn_id)
- getvm_instance = mock_getvm
- getvm_instance.return_value = ['test-image', 'test-sku']
- pool = hook.configure_pool(
- pool_id='mypool',
- vm_size="test_vm_size",
- use_latest_image_and_sku=True,
- vm_publisher="test.vm.publisher",
- vm_offer="test.vm.offer",
- sku_starts_with="test-sku",
- )
- assert isinstance(pool, batch_models.PoolAddParameter)
|