<commit_before>package jira

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"testing"
)

func TestFilterService_GetList(t *testing.T) {
	setup()
	defer teardown()
	testAPIEdpoint := "/rest/api/2/filter"
	raw, err := ioutil.ReadFile("./mocks/all_filters.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEdpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEdpoint)
		fmt.Fprint(writer, string(raw))
	})

	filters, _, err := testClient.Filter.GetList()
	if filters == nil {
		t.Error("Expected Filters list. Filters list is nil")
	}
	if err != nil {
		t.Errorf("Error given: %s", err)
	}
}

func TestFilterService_Get(t *testing.T) {
	setup()
	defer teardown()
	testAPIEdpoint := "/rest/api/2/filter/10000"
	raw, err := ioutil.ReadFile("./mocks/filter.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEdpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEdpoint)
		fmt.Fprintf(writer, string(raw))
	})

	filter, _, err := testClient.Filter.Get(10000)
	if filter == nil {
		t.Errorf("Expected Filter, got nil")
	}
	if err != nil {
		t.Errorf("Error given: %s", err)
	}

}

func TestFilterService_GetFavouriteList(t *testing.T) {
	setup()
	defer teardown()
	testAPIEdpoint := "/rest/api/2/filter/favourite"
	raw, err := ioutil.ReadFile("./mocks/favourite_filters.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEdpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEdpoint)
		fmt.Fprint(writer, string(raw))
	})
<commit_msg>fix: Fix typos in filter_test.go<commit_after>package jira

import (
	"fmt"
	"io/ioutil"
	"net/http"
	"testing"
)

func TestFilterService_GetList(t *testing.T) {
	setup()
	defer teardown()
	testAPIEndpoint := "/rest/api/2/filter"
	raw, err := ioutil.ReadFile("./mocks/all_filters.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEndpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEndpoint)
		fmt.Fprint(writer, string(raw))
	})

	filters, _, err := testClient.Filter.GetList()
	if filters == nil {
		t.Error("Expected Filters list. Filters list is nil")
	}
	if err != nil {
		t.Errorf("Error given: %s", err)
	}
}

func TestFilterService_Get(t *testing.T) {
	setup()
	defer teardown()
	testAPIEndpoint := "/rest/api/2/filter/10000"
	raw, err := ioutil.ReadFile("./mocks/filter.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEndpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEndpoint)
		fmt.Fprintf(writer, string(raw))
	})

	filter, _, err := testClient.Filter.Get(10000)
	if filter == nil {
		t.Errorf("Expected Filter, got nil")
	}
	if err != nil {
		t.Errorf("Error given: %s", err)
	}

}

func TestFilterService_GetFavouriteList(t *testing.T) {
	setup()
	defer teardown()
	testAPIEndpoint := "/rest/api/2/filter/favourite"
	raw, err := ioutil.ReadFile("./mocks/favourite_filters.json")
	if err != nil {
		t.Error(err.Error())
	}
	testMux.HandleFunc(testAPIEndpoint, func(writer http.ResponseWriter, request *http.Request) {
		testMethod(t, request, "GET")
		testRequestURL(t, request, testAPIEndpoint)
		fmt.Fprint(writer, string(raw))
	})

{'fraction_non_alphanumeric': 0.15974985787379192, 'fraction_numerical': 0.007390562819783968, 'mean_word_length': 4.621405750798722, 'pattern_counts': {'":': 0, '<': 3, '<?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': '4351478', 'n_tokens_mistral': 1384, 'n_tokens_neox': 1325, 'n_words': 260}