<commit_before>package integration_test

import (
	"path/filepath"
	"regexp"
	"strconv"

	"github.com/blang/semver"
	"github.com/cloudfoundry/libbuildpack"
	"github.com/cloudfoundry/libbuildpack/cutlass"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("CF Python Buildpack", func() {
	var app *cutlass.App

	AfterEach(func() {
		if app != nil {
			app.Destroy()
		}
		app = nil
	})

	Context("with an unsupported dependency", func() {
		BeforeEach(func() {
			app = cutlass.New(filepath.Join(bpDir, "fixtures", "unsupported_version"))
		})

		It("displays a nice error messages and gracefully fails", func() {
			Expect(app.Push()).ToNot(Succeed())
			Expect(app.ConfirmBuildpack(buildpackVersion)).To(Succeed())

			Eventually(app.Stdout.String()).Should(ContainSubstring("Could not install python: no match found for 99.99.99"))
			Eventually(app.Stdout.String()).ShouldNot(ContainSubstring("-----> Installing"))
		})
	})

	It("deploy a web app with -e in requirements.txt", func() {
		app = cutlass.New(filepath.Join(bpDir, "fixtures", "flask_git_req"))
		app.SetEnv("BP_DEBUG", "1")
		PushAppAndConfirm(app)

		Expect(app.GetBody("/")).To(ContainSubstring("Hello, World!"))
		Expect(app.Stdout.String()).NotTo(ContainSubstring("Error while running"))
		Expect(app.Stdout.String()).NotTo(ContainSubstring("ImportError:"))
		Expect(app.Stdout.String()).To(ContainSubstring("Dir checksum unchanged"))

		By("Caching pip files", func() {
			Expect(app.Stdout.String()).To(ContainSubstring("Size of pip cache dir: "))<commit_msg>Update test expectation to be more specific<commit_after>package integration_test

import (
	"path/filepath"
	"regexp"
	"strconv"

	"github.com/blang/semver"
	"github.com/cloudfoundry/libbuildpack"
	"github.com/cloudfoundry/libbuildpack/cutlass"
	. "github.com/onsi/ginkgo"
	. "github.com/onsi/gomega"
)

var _ = Describe("CF Python Buildpack", func() {
	var app *cutlass.App

	AfterEach(func() {
		if app != nil {
			app.Destroy()
		}
		app = nil
	})

	Context("with an unsupported dependency", func() {
		BeforeEach(func() {
			app = cutlass.New(filepath.Join(bpDir, "fixtures", "unsupported_version"))
		})

		It("displays a nice error messages and gracefully fails", func() {
			Expect(app.Push()).ToNot(Succeed())
			Expect(app.ConfirmBuildpack(buildpackVersion)).To(Succeed())

			Eventually(app.Stdout.String()).Should(ContainSubstring("Could not install python: no match found for 99.99.99"))
			Eventually(app.Stdout.String()).ShouldNot(ContainSubstring("-----> Installing python"))
		})
	})

	It("deploy a web app with -e in requirements.txt", func() {
		app = cutlass.New(filepath.Join(bpDir, "fixtures", "flask_git_req"))
		app.SetEnv("BP_DEBUG", "1")
		PushAppAndConfirm(app)

		Expect(app.GetBody("/")).To(ContainSubstring("Hello, World!"))
		Expect(app.Stdout.String()).NotTo(ContainSubstring("Error while running"))
		Expect(app.Stdout.String()).NotTo(ContainSubstring("ImportError:"))
		Expect(app.Stdout.String()).To(ContainSubstring("Dir checksum unchanged"))

		By("Caching pip files", func() {
			Expect(app.Stdout.String()).To(ContainSubstring("Size of pip cache dir: "))
{'fraction_non_alphanumeric': 0.1689425214353763, 'fraction_numerical': 0.004445855827246745, 'mean_word_length': 5.200787401574803, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4549375', 'n_tokens_mistral': 1174, 'n_tokens_neox': 1081, 'n_words': 191}