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

Side by Side Diff: impl/dummy/dummy_test.go

Issue 2977773002: [dummy/info] Mock ModuleHostname and related functions. (Closed)
Patch Set: Created 3 years, 5 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 | « impl/dummy/dummy.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
1 // Copyright 2015 The LUCI Authors. 1 // Copyright 2015 The LUCI Authors.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // needed for everything else 50 // needed for everything else
51 c = infoS.Set(c, Info()) 51 c = infoS.Set(c, Info())
52 52
53 Convey("Info", func() { 53 Convey("Info", func() {
54 So(infoS.Raw(c), ShouldNotBeNil) 54 So(infoS.Raw(c), ShouldNotBeNil)
55 So(func() { 55 So(func() {
56 defer p() 56 defer p()
57 infoS.Raw(c).Datacenter() 57 infoS.Raw(c).Datacenter()
58 }, ShouldPanicWith, "dummy: method Info.Datacenter is no t implemented") 58 }, ShouldPanicWith, "dummy: method Info.Datacenter is no t implemented")
59
60 Convey("ModuleHostname", func() {
61 host, err := infoS.ModuleHostname(c, "", "", "")
62 So(err, ShouldBeNil)
63 So(host, ShouldEqual, "version.module.dummy-appi d.example.com")
64
65 host, err = infoS.ModuleHostname(c, "wut", "10", "")
66 So(err, ShouldBeNil)
67 So(host, ShouldEqual, "10.wut.dummy-appid.exampl e.com")
68 })
59 }) 69 })
60 70
61 Convey("Datastore", func() { 71 Convey("Datastore", func() {
62 c = dsS.SetRaw(c, Datastore()) 72 c = dsS.SetRaw(c, Datastore())
63 So(dsS.Raw(c), ShouldNotBeNil) 73 So(dsS.Raw(c), ShouldNotBeNil)
64 So(func() { 74 So(func() {
65 defer p() 75 defer p()
66 _, _ = dsS.Raw(c).DecodeCursor("wut") 76 _, _ = dsS.Raw(c).DecodeCursor("wut")
67 }, ShouldPanicWith, "dummy: method Datastore.DecodeCurso r is not implemented") 77 }, ShouldPanicWith, "dummy: method Datastore.DecodeCurso r is not implemented")
68 }) 78 })
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 Convey("Module", func() { 116 Convey("Module", func() {
107 c = modS.Set(c, Module()) 117 c = modS.Set(c, Module())
108 So(modS.Raw(c), ShouldNotBeNil) 118 So(modS.Raw(c), ShouldNotBeNil)
109 So(func() { 119 So(func() {
110 defer p() 120 defer p()
111 modS.List(c) 121 modS.List(c)
112 }, ShouldPanicWith, "dummy: method Module.List is not im plemented") 122 }, ShouldPanicWith, "dummy: method Module.List is not im plemented")
113 }) 123 })
114 }) 124 })
115 } 125 }
OLDNEW
« no previous file with comments | « impl/dummy/dummy.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698