| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |