| OLD | NEW |
| 1 // Copyright 2015 The LUCI Authors. All rights reserved. | 1 // Copyright 2015 The LUCI Authors. All rights reserved. |
| 2 // Use of this source code is governed under the Apache License, Version 2.0 | 2 // Use of this source code is governed under the Apache License, Version 2.0 |
| 3 // that can be found in the LICENSE file. | 3 // that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // +build appengine | 5 // +build appengine |
| 6 | 6 |
| 7 package prod | 7 package prod |
| 8 | 8 |
| 9 import ( | 9 import ( |
| 10 "testing" | 10 "testing" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 // of the test... yeah I know. | 61 // of the test... yeah I know. |
| 62 logging.Debugf(ctx, "SHOULD NOT SEE") | 62 logging.Debugf(ctx, "SHOULD NOT SEE") |
| 63 logging.Infof(ctx, "SHOULD SEE") | 63 logging.Infof(ctx, "SHOULD SEE") |
| 64 | 64 |
| 65 ctx = logging.SetLevel(ctx, logging.Debug) | 65 ctx = logging.SetLevel(ctx, logging.Debug) |
| 66 logging.Debugf(ctx, "SHOULD SEE") | 66 logging.Debugf(ctx, "SHOULD SEE") |
| 67 logging.Infof(ctx, "SHOULD SEE (2)") | 67 logging.Infof(ctx, "SHOULD SEE (2)") |
| 68 }) | 68 }) |
| 69 | 69 |
| 70 Convey("Can probe/change Namespace", func() { | 70 Convey("Can probe/change Namespace", func() { |
| 71 » » » So(inf.GetNamespace(), ShouldEqual, "") | 71 » » » ns, has := inf.GetNamespace() |
| 72 » » » So(ns, ShouldEqual, "") |
| 73 » » » So(has, ShouldBeFalse) |
| 74 |
| 72 ctx, err = inf.Namespace("wat") | 75 ctx, err = inf.Namespace("wat") |
| 73 So(err, ShouldBeNil) | 76 So(err, ShouldBeNil) |
| 74 inf = info.Get(ctx) | 77 inf = info.Get(ctx) |
| 75 » » » So(inf.GetNamespace(), ShouldEqual, "wat") | 78 |
| 79 » » » ns, has = inf.GetNamespace() |
| 80 » » » So(ns, ShouldEqual, "wat") |
| 81 » » » So(has, ShouldBeTrue) |
| 82 |
| 76 ds = datastore.Get(ctx) | 83 ds = datastore.Get(ctx) |
| 77 So(ds.MakeKey("Hello", "world").Namespace(), ShouldEqual
, "wat") | 84 So(ds.MakeKey("Hello", "world").Namespace(), ShouldEqual
, "wat") |
| 78 }) | 85 }) |
| 79 | 86 |
| 80 Convey("Can get non-transactional context", func() { | 87 Convey("Can get non-transactional context", func() { |
| 81 ctx, err := inf.Namespace("foo") | 88 ctx, err := inf.Namespace("foo") |
| 82 So(err, ShouldBeNil) | 89 So(err, ShouldBeNil) |
| 83 ds = datastore.Get(ctx) | 90 ds = datastore.Get(ctx) |
| 84 inf = info.Get(ctx) | 91 inf = info.Get(ctx) |
| 85 | 92 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 | 263 |
| 257 Convey("memcache: Set (nil) is the same as Set ([]byte{})", func
() { | 264 Convey("memcache: Set (nil) is the same as Set ([]byte{})", func
() { |
| 258 So(mc.Set(mc.NewItem("bob")), ShouldBeNil) // normally w
ould panic because Value is nil | 265 So(mc.Set(mc.NewItem("bob")), ShouldBeNil) // normally w
ould panic because Value is nil |
| 259 | 266 |
| 260 bob, err := mc.Get("bob") | 267 bob, err := mc.Get("bob") |
| 261 So(err, ShouldBeNil) | 268 So(err, ShouldBeNil) |
| 262 So(bob.Value(), ShouldResemble, []byte{}) | 269 So(bob.Value(), ShouldResemble, []byte{}) |
| 263 }) | 270 }) |
| 264 }) | 271 }) |
| 265 } | 272 } |
| OLD | NEW |