def test_delete_vmss_having_no_vmss(fetch): with pytest.raises(FailedActivity) as x: resource_list = [] fetch.return_value = resource_list delete_vmss(None, None, None) assert "No virtual machine scale sets found" in str(x)
def test_delete_vmss(client, fetch_instances, fetch_vmss): vmss_list = [resource_vmss] fetch_vmss.return_value = vmss_list instances_list = [resource_vmss_instance] fetch_instances.return_value = instances_list client.return_value = MockComputeManagementClient() delete_vmss(None, None, None)
def test_delete_vmss_having_no_vmss_instances(fetch_instances, fetch_vmss): with pytest.raises(FailedActivity) as x: vmss_list = [resource_vmss] fetch_vmss.return_value = vmss_list instances_list = [] fetch_instances.return_value = instances_list delete_vmss(None, None, None) assert "No virtual machine scale set instances found" in str(x)
def test_delete_vmss(client, fetch_instances, fetch_vmss): scale_set = vmss_provider.provide_scale_set() scale_sets = [scale_set] instance = vmss_provider.provide_instance() instances = [instance] fetch_vmss.return_value = scale_sets fetch_instances.return_value = instances client.return_value = MockComputeManagementClient() delete_vmss(None, None, None)