Chromium Code Reviews

Side by Side Diff: service/datastore/properties_test.go

Issue 2302743002: Interface update, per-method Contexts. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff |
OLDNEW
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 package datastore 5 package datastore
6 6
7 import ( 7 import (
8 "fmt" 8 "fmt"
9 "math" 9 "math"
10 "sort" 10 "sort"
(...skipping 73 matching lines...)
84 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex) 84 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex)
85 So(pv.Type().String(), ShouldEqual, "PTS tring") 85 So(pv.Type().String(), ShouldEqual, "PTS tring")
86 }) 86 })
87 Convey("blobstore.Key is distinquished", func() { 87 Convey("blobstore.Key is distinquished", func() {
88 pv := MkProperty(blobstore.Key("sup")) 88 pv := MkProperty(blobstore.Key("sup"))
89 So(pv.Value(), ShouldEqual, blobstore.Ke y("sup")) 89 So(pv.Value(), ShouldEqual, blobstore.Ke y("sup"))
90 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex) 90 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex)
91 So(pv.Type().String(), ShouldEqual, "PTB lobKey") 91 So(pv.Type().String(), ShouldEqual, "PTB lobKey")
92 }) 92 })
93 Convey("datastore Key is distinguished", func() { 93 Convey("datastore Key is distinguished", func() {
94 » » » » » k := MakeKey("appid", "ns", "kind", "1") 94 » » » » » k := KeyContext{"appid", "ns"}.MakeKey(" kind", "1")
95 pv := MkProperty(k) 95 pv := MkProperty(k)
96 So(pv.Value(), ShouldHaveSameTypeAs, k) 96 So(pv.Value(), ShouldHaveSameTypeAs, k)
97 So(pv.Value().(*Key).Equal(k), ShouldBeT rue) 97 So(pv.Value().(*Key).Equal(k), ShouldBeT rue)
98 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex) 98 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex)
99 So(pv.Type().String(), ShouldEqual, "PTK ey") 99 So(pv.Type().String(), ShouldEqual, "PTK ey")
100 100
101 pv = MkProperty((*Key)(nil)) 101 pv = MkProperty((*Key)(nil))
102 So(pv.Value(), ShouldBeNil) 102 So(pv.Value(), ShouldBeNil)
103 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex) 103 So(pv.IndexSetting(), ShouldEqual, Shoul dIndex)
104 So(pv.Type().String(), ShouldEqual, "PTN ull") 104 So(pv.Type().String(), ShouldEqual, "PTN ull")
(...skipping 204 matching lines...)
309 cmpBS, _ := c.co nv(tc.cmpS) 309 cmpBS, _ := c.co nv(tc.cmpS)
310 So(cmpByteSequen ce(bs, cmpBS), tc.assertion, 0) 310 So(cmpByteSequen ce(bs, cmpBS), tc.assertion, 0)
311 }) 311 })
312 } 312 }
313 } 313 }
314 }) 314 })
315 } 315 }
316 } 316 }
317 }) 317 })
318 } 318 }
OLDNEW

Powered by Google App Engine