<commit_before>package contentful_test

import (
	"fmt"
	"strings"
	"testing"

	"github.com/jasonbio/contentful"
)

func TestGetEntry(t *testing.T) {
	var entryId string = "nyancat"
	client := createClient()
	entry, err := client.GetEntry(entryId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(entry.Sys.Id, entryId) {
		t.Error(fmt.Sprintf("Expected %s got %s", entryId, entry.Sys.Id))
		t.Fail()
	}
}
func TestGetSpace(t *testing.T) {
	var spaceId string = "cfexampleapi"
	client := createClient()
	space, err := client.GetSpace(spaceId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(space.Sys.Id, spaceId) {
		t.Error(fmt.Sprintf("Expected %s got %s", spaceId, space.Sys.Id))
		t.Fail()
	}
}
func TestGetContentType(t *testing.T) {
	var contentTypeId string = "cat"
	client := createClient()
	contentType, err := client.GetContentType(contentTypeId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(contentType.Sys.Id, contentTypeId) {
		t.Error(fmt.Sprintf("Expected %s got %s", contentTypeId, contentType.Sys.Id))
		t.Fail()
	}
}
func TestGetEntries(t *testing.T) {
	client := createClient()
	entities, err := client.GetEntries(nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if len(entities.Items) == 0 {
		t.Fail()
	}
}
func TestGetContentTypes(t *testing.T) {
	client := createClient()
	contentTypes, err := client.GetContentTypes(nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if len(contentTypes.Items) == 0 {
		t.Fail()
	}
}
func createClient() contentful.Contentful {
	return contentful.CreateClient("cfexampleapi", "b4c0n73n7fu1")
}<commit_msg>initial commit<commit_after>package contentful_test

import (
	"fmt"
	"strings"
	"testing"

	"github.com/jasonbio/contentful"
)

func TestGetEntry(t *testing.T) {
	var entryId string = "exampleentry"
	client := createClient()
	entry, err := client.GetEntry(entryId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(entry.Sys.Id, entryId) {
		t.Error(fmt.Sprintf("Expected %s got %s", entryId, entry.Sys.Id))
		t.Fail()
	}
}
func TestGetSpace(t *testing.T) {
	var spaceId string = "examplespace"
	client := createClient()
	space, err := client.GetSpace(spaceId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(space.Sys.Id, spaceId) {
		t.Error(fmt.Sprintf("Expected %s got %s", spaceId, space.Sys.Id))
		t.Fail()
	}
}
func TestGetContentType(t *testing.T) {
	var contentTypeId string = "cat"
	client := createClient()
	contentType, err := client.GetContentType(contentTypeId, nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if !strings.EqualFold(contentType.Sys.Id, contentTypeId) {
		t.Error(fmt.Sprintf("Expected %s got %s", contentTypeId, contentType.Sys.Id))
		t.Fail()
	}
}
func TestGetEntries(t *testing.T) {
	client := createClient()
	entities, err := client.GetEntries(nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if len(entities.Items) == 0 {
		t.Fail()
	}
}
func TestGetContentTypes(t *testing.T) {
	client := createClient()
	contentTypes, err := client.GetContentTypes(nil)
	if err != nil {
		t.Error(fmt.Sprintf("expected err == nil got %v", err))
	}
	if len(contentTypes.Items) == 0 {
		t.Fail()
	}
}
func createClient() contentful.Contentful {
	return contentful.CreateClient("examplespace", "examplekey")
}
{'fraction_non_alphanumeric': 0.16528468767274737, 'fraction_numerical': 0.002763957987838585, 'mean_word_length': 4.483333333333333, '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': '3664230', 'n_tokens_mistral': 1376, 'n_tokens_neox': 1347, 'n_words': 303}