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

Unified Diff: appengine/ephelper/epfrontend/discovery_test.go

Issue 1750143003: Remove ephelper and other endpoints code. (Closed) Base URL: https://github.com/luci/luci-go@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: appengine/ephelper/epfrontend/discovery_test.go
diff --git a/appengine/ephelper/epfrontend/discovery_test.go b/appengine/ephelper/epfrontend/discovery_test.go
deleted file mode 100644
index d674b7ddd0e0123b31f154cfa04de50b0b68ba5a..0000000000000000000000000000000000000000
--- a/appengine/ephelper/epfrontend/discovery_test.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package epfrontend
-
-import (
- "encoding/json"
- "fmt"
- "io/ioutil"
- "net/url"
- "path/filepath"
- "testing"
-
- "github.com/GoogleCloudPlatform/go-endpoints/endpoints"
- . "github.com/smartystreets/goconvey/convey"
-)
-
-type discoveryTestCase struct {
- backend endpoints.APIDescriptor
- frontend restDescription
-}
-
-func loadJSONTestCase(d interface{}, suite, name, kind string) {
- path := filepath.Join(fmt.Sprintf("%s_testdata", suite), fmt.Sprintf("%s_%s.json", name, kind))
- data, err := ioutil.ReadFile(path)
- if err != nil {
- panic(fmt.Errorf("failed to load test data [%s]: %v", path, err))
- }
-
- if err := json.Unmarshal(data, d); err != nil {
- panic(fmt.Errorf("failed to unmarshal [%s]: %v", path, err))
- }
-}
-
-func loadDiscoveryTestCase(name string) *discoveryTestCase {
- tc := discoveryTestCase{}
- loadJSONTestCase(&tc.backend, "discovery", name, "backend")
- loadJSONTestCase(&tc.frontend, "discovery", name, "frontend")
- return &tc
-}
-
-func TestBuildRestDescription(t *testing.T) {
- Convey(`A testing APIDescriptor`, t, func() {
- u, err := url.Parse("https://example.com/testing/v1")
- So(err, ShouldBeNil)
-
- for _, tcName := range []string{
- "basic",
- "query_get",
- } {
- Convey(fmt.Sprintf(`Correctly loads/generates the %q test case.`, tcName), func() {
-
- tc := loadDiscoveryTestCase(tcName)
- rd, err := buildRestDescription(u, &tc.backend)
- So(err, ShouldBeNil)
- So(rd, ShouldResemble, &tc.frontend)
- })
- }
- })
-}
« no previous file with comments | « appengine/ephelper/epfrontend/discovery.go ('k') | appengine/ephelper/epfrontend/discovery_testdata/basic_backend.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698