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

Unified Diff: go/src/infra/gae/libs/wrapper/memory/key_test.go

Issue 1222903002: Refactor current GAE abstraction library to be free of the SDK* (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: more fixes Created 5 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 side-by-side diff with in-line comments
Download patch
Index: go/src/infra/gae/libs/wrapper/memory/key_test.go
diff --git a/go/src/infra/gae/libs/wrapper/memory/key_test.go b/go/src/infra/gae/libs/wrapper/memory/key_test.go
deleted file mode 100644
index 3bb9f8e994a2932dc82f7aec2ced6264ecff54d6..0000000000000000000000000000000000000000
--- a/go/src/infra/gae/libs/wrapper/memory/key_test.go
+++ /dev/null
@@ -1,51 +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 memory
-
-import (
- "bytes"
- "fmt"
- "infra/gae/libs/wrapper"
- "testing"
-
- . "github.com/smartystreets/goconvey/convey"
- "golang.org/x/net/context"
-
- "appengine/datastore"
-)
-
-func shouldEqualKey(ai interface{}, bis ...interface{}) string {
- if len(bis) != 1 {
- return "too many bees!"
- }
- a, b := ai.(*datastore.Key), bis[0].(*datastore.Key)
- if !a.Equal(b) {
- return fmt.Sprintf("Expected: %s\nActual: %s", b.String(), a.String())
- }
- return ""
-}
-
-func TestKeyBinaryStuff(t *testing.T) {
- t.Parallel()
-
- Convey("Key binary encoding", t, func() {
- c := Use(context.Background())
- c, err := wrapper.GetGI(c).Namespace("bobspace")
- So(err, ShouldBeNil)
- ds := wrapper.GetDS(c)
-
- k := ds.NewKey("Bunny", "", 10, ds.NewKey("Parent", "Cat", 0, nil))
- So(k.Namespace(), ShouldEqual, "bobspace")
-
- b := &bytes.Buffer{}
- writeKey(b, withNS, k)
-
- newk, err := readKey(b, withNS, "")
- So(err, ShouldBeNil)
- So(k.Namespace(), ShouldEqual, "bobspace")
- So(newk, shouldEqualKey, k)
- So(b.Bytes(), ShouldBeEmpty)
- })
-}

Powered by Google App Engine
This is Rietveld 408576698