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

Unified Diff: impl/memory/module_test.go

Issue 1772943003: Add wrappers for the module module (Closed) Base URL: https://github.com/luci/gae.git@master
Patch Set: CL comments 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/module.go ('k') | impl/prod/context.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: impl/memory/module_test.go
diff --git a/impl/memory/module_test.go b/impl/memory/module_test.go
new file mode 100644
index 0000000000000000000000000000000000000000..2b26956b3a1f72a2c7be01b27c4bb61eb5ca66a9
--- /dev/null
+++ b/impl/memory/module_test.go
@@ -0,0 +1,34 @@
+// 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/module"
+ "golang.org/x/net/context"
+
+ . "github.com/smartystreets/goconvey/convey"
+)
+
+func TestModule(t *testing.T) {
+ Convey("NumInstances", t, func() {
+ c := Use(context.Background())
+ m := module.Get(c)
+
+ i, err := m.NumInstances("foo", "bar")
+ So(i, ShouldEqual, 1)
+ So(err, ShouldBeNil)
+
+ So(m.SetNumInstances("foo", "bar", 42), ShouldBeNil)
+ i, err = m.NumInstances("foo", "bar")
+ So(i, ShouldEqual, 42)
+ So(err, ShouldBeNil)
+
+ i, err = m.NumInstances("foo", "baz")
+ So(i, ShouldEqual, 1)
+ So(err, ShouldBeNil)
+ })
+}
« no previous file with comments | « impl/memory/module.go ('k') | impl/prod/context.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698