Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(205)

Side by Side Diff: vpython/python/python_test.go

Issue 2905943002: [vpython] Incorporate interpreter path/hash. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « vpython/python/interpreter.go ('k') | vpython/spec/spec.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The LUCI Authors. All rights reserved. 1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0 2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file. 3 // that can be found in the LICENSE file.
4 4
5 package python 5 package python
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "os" 9 "os"
10 "os/exec" 10 "os/exec"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 t.Fatalf("failed to get executable name: %s", err) 116 t.Fatalf("failed to get executable name: %s", err)
117 } 117 }
118 118
119 Convey(`A Python interpreter`, t, func() { 119 Convey(`A Python interpreter`, t, func() {
120 c := context.Background() 120 c := context.Background()
121 121
122 i := Interpreter{ 122 i := Interpreter{
123 Python: self, 123 Python: self,
124 } 124 }
125 125
126 Convey(`Testing hash`, func() {
127 hash, err := i.Hash()
128 So(err, ShouldBeNil)
129 So(hash, ShouldNotEqual, "")
130
131 t.Logf("Calculated interpreter hash: %s", hash)
132 })
133
126 Convey(`Testing IsolatedCommand`, func() { 134 Convey(`Testing IsolatedCommand`, func() {
127 cmd := i.IsolatedCommand(c, "foo", "bar") 135 cmd := i.IsolatedCommand(c, "foo", "bar")
128 So(cmd.Args, ShouldResemble, []string{self, "-B", "-E", "-s", "foo", "bar"}) 136 So(cmd.Args, ShouldResemble, []string{self, "-B", "-E", "-s", "foo", "bar"})
129 }) 137 })
130 138
131 }) 139 })
132 } 140 }
133 141
134 func TestInterpreterGetVersion(t *testing.T) { 142 func TestInterpreterGetVersion(t *testing.T) {
135 t.Parallel() 143 t.Parallel()
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
188 for _, tc := range versionFailures { 196 for _, tc := range versionFailures {
189 Convey(fmt.Sprintf(`Will fail to parse %q (%s)`, tc.outp ut, tc.err), func() { 197 Convey(fmt.Sprintf(`Will fail to parse %q (%s)`, tc.outp ut, tc.err), func() {
190 versionString = tc.output 198 versionString = tc.output
191 199
192 _, err := i.GetVersion(c) 200 _, err := i.GetVersion(c)
193 So(err, ShouldErrLike, tc.err) 201 So(err, ShouldErrLike, tc.err)
194 }) 202 })
195 } 203 }
196 }) 204 })
197 } 205 }
OLDNEW
« no previous file with comments | « vpython/python/interpreter.go ('k') | vpython/spec/spec.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698