<commit_before>package kit

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"sort"
	"testing"

	"github.com/Shopify/themekit/theme"
	"github.com/stretchr/testify/assert"
)

var globalEventLog chan ThemeEvent

type TestEvent struct {
	asset     theme.Asset
	eventType EventType
}

func (t TestEvent) Asset() theme.Asset {
	return t.asset
}

func (t TestEvent) Type() EventType {
	return t.eventType
}

func TestPerformWithUpdateAssetEvent(t *testing.T) {
	ts := assertRequest(t, "PUT", "asset", map[string]string{"value": "Hello World", "key": "assets/hello.txt"})
	defer ts.Close()
	asset := TestEvent{asset: asset(), eventType: Update}
	client := NewThemeClient(globalEventLog, conf(ts))
	client.Perform(asset)
}
<commit_msg>testing is all fixed<commit_after>package kit

import (
	"encoding/json"
	"fmt"
	"io/ioutil"
	"net/http"
	"net/http/httptest"
	"sort"
	"testing"

	"github.com/Shopify/themekit/theme"
	"github.com/stretchr/testify/assert"
)

var globalEventLog = make(chan ThemeEvent, 100)

type TestEvent struct {
	asset     theme.Asset
	eventType EventType
}

func (t TestEvent) Asset() theme.Asset {
	return t.asset
}

func (t TestEvent) Type() EventType {
	return t.eventType
}

func TestPerformWithUpdateAssetEvent(t *testing.T) {
	ts := assertRequest(t, "PUT", "asset", map[string]string{"value": "Hello World", "key": "assets/hello.txt"})
	defer ts.Close()
	asset := TestEvent{asset: asset(), eventType: Update}
	client := NewThemeClient(globalEventLog, conf(ts))
	client.Perform(asset)
}

{'fraction_non_alphanumeric': 0.14583333333333334, 'fraction_numerical': 0.001953125, 'mean_word_length': 5.051181102362205, 'pattern_counts': {'":': 4, '<': 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': '7115770', 'n_tokens_mistral': 576, 'n_tokens_neox': 563, 'n_words': 124}