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

Unified Diff: impl/memory/info_test.go

Issue 1766593002: Add a MustNamespace that panics if the namespace wasn't valid (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: Add MustNamespace to the interface Created 4 years, 9 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 | « impl/memory/info.go ('k') | impl/prod/info.go » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..6c7fbac611825bb30f14f23e1a7a23aa007a58e1
--- /dev/null
+++ b/impl/memory/info_test.go
@@ -0,0 +1,28 @@
+// 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 (
+ "testing"
+
+ "github.com/luci/gae/service/info"
+ "golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestMustNamespace(t *testing.T) {
+ Convey("MustNamespace panics", t, func() {
+ c := Use(context.Background())
+ i := info.Get(c)
+
+ So(func() {
+ i.MustNamespace("valid_namespace_name")
+ }, ShouldNotPanic)
+ So(func() {
+ i.MustNamespace("invalid namespace name")
+ }, ShouldPanic)
+ })
+}
« no previous file with comments | « impl/memory/info.go ('k') | impl/prod/info.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698