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

Unified Diff: server/discovery/internal/testservices/discovery_test.go

Issue 1587323003: client/cmd/rpc: RPC CLI (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/luci-go@discovery
Patch Set: rebased Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « common/proto/google/descriptor/util_test.proto ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: server/discovery/internal/testservices/discovery_test.go
diff --git a/server/discovery/internal/testservices/discovery_test.go b/server/discovery/internal/testservices/discovery_test.go
index 0fd4a385eec5c4c2009709c159765dfa050b9a1a..c51544101d7a1eef8b9589e0a4155ed4f7d58d93 100644
--- a/server/discovery/internal/testservices/discovery_test.go
+++ b/server/discovery/internal/testservices/discovery_test.go
@@ -54,20 +54,24 @@ func TestDiscovery(t *testing.T) {
// this checks that file deduplication actually works.
So(len(desc.File), ShouldEqual, 2)
- discovery := desc.FindService("discovery.Discovery")
- So(discovery, ShouldNotBeNil)
+ _, discoveryIndex := desc.FindService("discovery.Discovery")
+ So(discoveryIndex, ShouldNotEqual, -1)
- calc := desc.FindService("testservices.Calc")
- So(calc, ShouldNotBeNil)
+ _, calcIndex := desc.FindService("testservices.Calc")
+ So(calcIndex, ShouldNotEqual, -1)
- serviceDesc := desc.FindService("testservices.Greeter")
- So(serviceDesc, ShouldNotBeNil)
+ file, greeterIndex := desc.FindService("testservices.Greeter")
+ So(greeterIndex, ShouldNotEqual, -1)
+ greeter := file.Service[greeterIndex]
- sayHelloDesc := serviceDesc.FindMethod("SayHello")
- So(sayHelloDesc, ShouldNotBeNil)
+ sayHelloIndex := greeter.FindMethod("SayHello")
+ So(sayHelloIndex, ShouldNotEqual, -1)
+ sayHello := greeter.Method[sayHelloIndex]
- So(sayHelloDesc.GetInputType(), ShouldEqual, ".testservices.HelloRequest")
- helloReq := desc.FindMessage("testservices.HelloRequest")
+ So(sayHello.GetInputType(), ShouldEqual, ".testservices.HelloRequest")
+ _, obj, _ := desc.Resolve("testservices.HelloRequest")
+ So(obj, ShouldNotBeNil)
+ helloReq := obj.(*descriptor.DescriptorProto)
So(helloReq, ShouldNotBeNil)
So(helloReq.Field, ShouldHaveLength, 1)
So(helloReq.Field[0].GetName(), ShouldEqual, "name")
« no previous file with comments | « common/proto/google/descriptor/util_test.proto ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698