<commit_before>package azurerm

import (
	"fmt"
	"net/http"
	"regexp"
	"testing"

	"github.com/hashicorp/terraform/helper/acctest"
	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/terraform"
)

func TestAccAzureRMServiceBusNamespaceCapacity_validation(t *testing.T) {
	cases := []struct {
		Value    int
		ErrCount int
	}{
		{
			Value:    17,
			ErrCount: 1,<commit_msg>clean-up: Add the sweeper logic for servicebus namespaces<commit_after>package azurerm

import (
	"fmt"
	"net/http"
	"regexp"
	"testing"

	"log"

	"github.com/hashicorp/terraform/helper/acctest"
	"github.com/hashicorp/terraform/helper/resource"
	"github.com/hashicorp/terraform/terraform"
)

func init() {
	resource.AddTestSweepers("azurerm_servicebus_namespace", &resource.Sweeper{
		Name: "azurerm_servicebus_namespace",
		F:    testSweepServicebusNamespace,
	})
}

func testSweepServicebusNamespace(region string) error {
	armClient, err := buildConfigForSweepers()
	if err != nil {
		return err
	}

	client := (*armClient).serviceBusNamespacesClient

	log.Printf("Retrieving the Servicebus Namespaces..")
	results, err := client.ListBySubscription()
	if err != nil {
		return fmt.Errorf("Error Listing on Servicebus Namespaces: %+v", err)
	}

	for _, profile := range *results.Value {
		if !shouldSweepAcceptanceTestResource(*profile.Name, *profile.Location, region) {
			continue
		}

		resourceId, err := parseAzureResourceID(*profile.ID)
		if err != nil {
			return err
		}

		resourceGroup := resourceId.ResourceGroup
		name := resourceId.Path["namespaces"]

		log.Printf("Deleting Servicebus Namespace '%s' in Resource Group '%s'", name, resourceGroup)
		deleteResponse, error := client.Delete(resourceGroup, name, make(chan struct{}))
		err = <-error
		resp := <-deleteResponse
		if err != nil {
			if responseWasNotFound(resp) {
				return nil
			}
			return err
		}
	}

	return nil
}

func TestAccAzureRMServiceBusNamespaceCapacity_validation(t *testing.T) {
	cases := []struct {
		Value    int
		ErrCount int
	}{
		{
			Value:    17,
			ErrCount: 1,
{'fraction_non_alphanumeric': 0.12094823415578132, 'fraction_numerical': 0.002902757619738752, 'mean_word_length': 4.385416666666667, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5100872', 'n_tokens_mistral': 767, 'n_tokens_neox': 718, 'n_words': 145}