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

Side by Side Diff: impl/memory/datastore_query_execution_test.go

Issue 1916463004: impl/memory: Disallow empty namespace. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: Remove memcache. Created 4 years, 8 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package memory 5 package memory
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "strings" 9 "strings"
10 "testing" 10 "testing"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 func TestQueryExecution(t *testing.T) { 487 func TestQueryExecution(t *testing.T) {
488 t.Parallel() 488 t.Parallel()
489 489
490 Convey("Test query execution", t, func() { 490 Convey("Test query execution", t, func() {
491 c, err := info.Get(Use(context.Background())).Namespace("ns") 491 c, err := info.Get(Use(context.Background())).Namespace("ns")
492 if err != nil { 492 if err != nil {
493 panic(err) 493 panic(err)
494 } 494 }
495 495
496 So(info.Get(c).FullyQualifiedAppID(), ShouldEqual, "dev~app") 496 So(info.Get(c).FullyQualifiedAppID(), ShouldEqual, "dev~app")
497 » » So(info.Get(c).GetNamespace(), ShouldEqual, "ns") 497 » » ns, has := info.Get(c).GetNamespace()
498 » » So(ns, ShouldEqual, "ns")
499 » » So(has, ShouldBeTrue)
498 500
499 data := ds.Get(c) 501 data := ds.Get(c)
500 testing := data.Testable() 502 testing := data.Testable()
501 503
502 for _, tc := range queryExecutionTests { 504 for _, tc := range queryExecutionTests {
503 Convey(tc.name, func() { 505 Convey(tc.name, func() {
504 for i, stage := range tc.test { 506 for i, stage := range tc.test {
505 // outside of Convey, since these must a lways happen 507 // outside of Convey, since these must a lways happen
506 testing.CatchupIndexes() 508 testing.CatchupIndexes()
507 509
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 639
638 v, ok := actual.(error) 640 v, ok := actual.(error)
639 if !ok { 641 if !ok {
640 return fmt.Sprintf("type of 'actual' must be error, not %T", act ual) 642 return fmt.Sprintf("type of 'actual' must be error, not %T", act ual)
641 } 643 }
642 if v == nil || v == ds.Stop { 644 if v == nil || v == ds.Stop {
643 return "" 645 return ""
644 } 646 }
645 return fmt.Sprintf("expected success value, not %v", v) 647 return fmt.Sprintf("expected success value, not %v", v)
646 } 648 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698