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) |
+ }) |
+} |