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

Side by Side Diff: vpython/spec/spec_test.go

Issue 2864423002: vpython: Leave "pip" and related tools. (Closed)
Patch Set: fix word Created 3 years, 7 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/spec/spec.go ('k') | vpython/venv/config.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 spec 5 package spec
6 6
7 import ( 7 import (
8 "testing" 8 "testing"
9 9
10 "github.com/luci/luci-go/vpython/api/vpython" 10 "github.com/luci/luci-go/vpython/api/vpython"
(...skipping 19 matching lines...) Expand all
30 }) 30 })
31 }) 31 })
32 32
33 Convey(`Will normalize to sorted order.`, func() { 33 Convey(`Will normalize to sorted order.`, func() {
34 spec.Wheel = []*vpython.Spec_Package{pkgFoo, pkgBar, pkg Baz} 34 spec.Wheel = []*vpython.Spec_Package{pkgFoo, pkgBar, pkg Baz}
35 So(Normalize(&spec, nil), ShouldBeNil) 35 So(Normalize(&spec, nil), ShouldBeNil)
36 So(spec, ShouldResemble, vpython.Spec{ 36 So(spec, ShouldResemble, vpython.Spec{
37 Wheel: []*vpython.Spec_Package{pkgBar, pkgBaz, p kgFoo}, 37 Wheel: []*vpython.Spec_Package{pkgBar, pkgBaz, p kgFoo},
38 }) 38 })
39 39
40 » » » So(Hash(&spec), ShouldEqual, "b4221081c43e8319ceb71a2e9d 3bd83701b726a0976380feac4d04825226f935") 40 » » » So(Hash(&spec, ""), ShouldEqual, "b4221081c43e8319ceb71a 2e9d3bd83701b726a0976380feac4d04825226f935")
41 » » » So(Hash(&spec, "extra"), ShouldEqual, "01a8d5f5a6f7b2cd9 1ce6f2b5fefb931828e28b90d0fb07a271597eaa4f6c547")
41 }) 42 })
42 43
43 Convey(`Will fail to normalize if there are duplicate wheels.`, func() { 44 Convey(`Will fail to normalize if there are duplicate wheels.`, func() {
44 spec.Wheel = []*vpython.Spec_Package{pkgFoo, pkgFoo, pkg Bar, pkgBaz} 45 spec.Wheel = []*vpython.Spec_Package{pkgFoo, pkgFoo, pkg Bar, pkgBaz}
45 So(Normalize(&spec, nil), ShouldErrLike, "duplicate spec entries") 46 So(Normalize(&spec, nil), ShouldErrLike, "duplicate spec entries")
46 47
47 // Even if the versions differ. 48 // Even if the versions differ.
48 fooClone := *pkgFoo 49 fooClone := *pkgFoo
49 fooClone.Version = "other" 50 fooClone.Version = "other"
50 spec.Wheel = []*vpython.Spec_Package{pkgFoo, &fooClone, pkgBar, pkgBaz} 51 spec.Wheel = []*vpython.Spec_Package{pkgFoo, &fooClone, pkgBar, pkgBaz}
51 So(Normalize(&spec, nil), ShouldErrLike, "duplicate spec entries") 52 So(Normalize(&spec, nil), ShouldErrLike, "duplicate spec entries")
52 }) 53 })
53 }) 54 })
54 } 55 }
OLDNEW
« no previous file with comments | « vpython/spec/spec.go ('k') | vpython/venv/config.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698