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

Unified Diff: impl/memory/info_test.go

Issue 1916463004: impl/memory: Disallow empty namespace. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/luci/gae@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« impl/memory/datastore_query_execution_test.go ('K') | « impl/memory/info.go ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/info_test.go
diff --git a/impl/memory/info_test.go b/impl/memory/info_test.go
index 200f43764962e5d6d044fb5658c346ba61d3bdd5..07fcd09486f49fc46b9fdfa4427417ce73cdcdc1 100644
--- a/impl/memory/info_test.go
+++ b/impl/memory/info_test.go
@@ -5,6 +5,7 @@
package memory
import (
+ "fmt"
"testing"
"github.com/luci/gae/service/info"
@@ -18,12 +19,22 @@ func TestMustNamespace(t *testing.T) {
c := Use(context.Background())
i := info.Get(c)
- So(func() {
- i.MustNamespace("valid_namespace_name")
- }, ShouldNotPanic)
- So(func() {
- i.MustNamespace("invalid namespace name")
- }, ShouldPanic)
+ for _, ns := range []string{
+ "valid_namespace_name",
+ } {
+ Convey(fmt.Sprintf("%q is a valid namespace.", ns), func() {
+ So(func() { i.MustNamespace(ns) }, ShouldNotPanic)
+ })
+ }
+
+ for _, ns := range []string{
+ "",
+ "invalid namespace name",
+ } {
+ Convey(fmt.Sprintf("%q is an invalid namespace.", ns), func() {
+ So(func() { i.MustNamespace(ns) }, ShouldPanic)
+ })
+ }
})
Convey("Testable interface works", t, func() {
« impl/memory/datastore_query_execution_test.go ('K') | « impl/memory/info.go ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698