<commit_before>package keys_test

import (
	. "github.com/LewisWatson/Ginkgo-BDD-Testing-Framework-Lightning-Talk/step2"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Keys", func() {

	var (
		tokens      map[string]interface{}
		maxAge      int64
		err         error
		givenTokens map[string]interface{}
	)

	BeforeEach(func() {

		/*
		 * given
		 */

		givenTokens = make(map[string]interface{})
		givenTokens["key1"] = "<KEY>"
		givenTokens["key2"] = "<KEY>"
		givenTokens["key3"] = "<KEY>"
		// givenTokens["bad token"] = "bad token"

		givenMaxAge := int64(1001)

		/*
		 * when
		 */

		tokens, maxAge, err = GetKeys("keys.url", givenTokens, givenMaxAge, nil)
	})

	/*
	 * then
	 */

	It("should not return an error", func() {
		Expect(err).ToNot(HaveOccurred())
	})

	It("should return a max age greater than 1000", func() {
		Expect(maxAge).To(BeNumerically(">", 1000))
	})

	It("should return the expected tokens", func() {
		Expect(tokens).To(Equal(givenTokens))
	})

	It("should not return the bad token", func() {
		Expect(tokens).NotTo(ContainElement("bad token"))
	})
})<commit_msg>add test to step 2<commit_after>package keys_test

import (
	. "github.com/LewisWatson/Ginkgo-BDD-Testing-Framework-Lightning-Talk/step2/complete"

	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("Keys", func() {

	var (
		tokens      map[string]interface{}
		maxAge      int64
		err         error
		givenTokens map[string]interface{}
	)

	BeforeEach(func() {

		/*
		 * given
		 */

		givenTokens = make(map[string]interface{})
		givenTokens["key1"] = "<KEY>"
		givenTokens["key2"] = "<KEY>"
		givenTokens["key3"] = "<KEY>"
		// givenTokens["bad token"] = "bad token"

		givenMaxAge := int64(1001)

		/*
		 * when
		 */

		tokens, maxAge, err = GetKeys("keys.url", givenTokens, givenMaxAge, nil)
	})

	It("should not return an error", func() {
		Expect(err).NotTo(HaveOccurred())
	})

	It("should return a maxAge greater than 10", func() {
		Expect(maxAge).To(BeNumerically(">", 10))
	})

	It("should return the correct key map", func() {
		Expect(tokens).To(Equal(givenTokens))
	})

	It("should not return the bad token", func() {
		Expect(tokens).ToNot(ContainElement("bad token"))
	})

})
{'fraction_non_alphanumeric': 0.1742996887505558, 'fraction_numerical': 0.0164517563361494, 'mean_word_length': 3.658385093167702, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, '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': '5258033', 'n_tokens_mistral': 920, 'n_tokens_neox': 802, 'n_words': 157}