Skip to content

Commit ad66baf

Browse files
jfeenycf-buildpacks-eng
authored andcommitted
Wildcard default version of python [#158597509]
Signed-off-by: Danny Joyce <djoyce@pivotal.io>
1 parent 7a9f1a7 commit ad66baf

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

manifest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
language: python
33
default_versions:
44
- name: python
5-
version: 2.7.14
5+
version: 2.7.x
66
dependency_deprecation_dates:
77
- version_line: 2.7.x
88
name: python

src/python/integration/deploy_a_python_app_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
package integration_test
22

33
import (
4-
"fmt"
54
"path/filepath"
65
"regexp"
76
"strconv"
87

8+
"github.com/blang/semver"
99
"github.com/cloudfoundry/libbuildpack"
1010
"github.com/cloudfoundry/libbuildpack/cutlass"
1111
. "github.com/onsi/ginkgo"
@@ -155,7 +155,14 @@ var _ = Describe("CF Python Buildpack", func() {
155155
PushAppAndConfirm(app)
156156

157157
Expect(app.GetBody("/")).To(ContainSubstring("Hello, World!"))
158-
Expect(app.Stdout.String()).To(ContainSubstring(fmt.Sprintf("-----> Installing python %s", defaultV)))
158+
159+
re := regexp.MustCompile("Installing python (.*)[\r\n|\r|\n]")
160+
match := re.FindStringSubmatch(app.Stdout.String())
161+
foundVersion := match[1]
162+
163+
versionRange := semver.MustParseRange("<=" + defaultV)
164+
v1 := semver.MustParse(foundVersion)
165+
Expect(versionRange(v1)).To(BeTrue())
159166
})
160167
})
161168

0 commit comments

Comments
 (0)