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

Side by Side Diff: vpython/cipd/cipd_test.go

Issue 2699223002: vpython: Add CIPD support. (Closed)
Patch Set: Created 3 years, 10 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
« vpython/cipd/cipd.go ('K') | « vpython/cipd/cipd.go ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2017 The LUCI Authors. All rights reserved.
2 // Use of this source code is governed under the Apache License, Version 2.0
3 // that can be found in the LICENSE file.
4
5 package cipd
6
7 import (
8 "bytes"
9 "testing"
10
11 "github.com/luci/luci-go/vpython/api/env"
12
13 . "github.com/smartystreets/goconvey/convey"
14 )
15
16 func TestWriteEnsureFile(t *testing.T) {
17 t.Parallel()
18
19 Convey(`Test manifest generation`, t, func() {
20 var buf bytes.Buffer
21
22 Convey(`Invalid packages will panic.`, func() {
23 pkg := &env.Spec_Package{
24 Path: "foo/bar",
25 }
26 So(validatePackage(pkg), ShouldNotBeNil)
27 So(func() {
28 _ = writeEnsureFile(&buf, []*env.Spec_Package{pk g})
29 }, ShouldPanic)
30 })
31
32 Convey(`Can write a manifest for packages`, func() {
33 err := writeEnsureFile(&buf, []*env.Spec_Package{
34 &env.Spec_Package{"foo/bar", "baz"},
35 &env.Spec_Package{"pants", "key:value"},
36 })
37 So(err, ShouldBeNil)
38 So(buf.String(), ShouldResemble, "foo/bar baz\npants key :value\n")
39 })
40 })
41 }
OLDNEW
« vpython/cipd/cipd.go ('K') | « vpython/cipd/cipd.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698