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

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

Issue 1289323002: Fix miscellaneous prod bugs. (Closed) Base URL: https://github.com/luci/gae@master
Patch Set: Rebase. Created 5 years, 4 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 unified diff | Download patch
« no previous file with comments | « service/datastore/pls_impl.go ('k') | service/datastore/properties.go » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // adapted from github.com/golang/appengine/datastore 5 // adapted from github.com/golang/appengine/datastore
6 6
7 package datastore 7 package datastore
8 8
9 import ( 9 import (
10 "bytes" 10 "bytes"
(...skipping 1781 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 type OKDefaults struct { 1792 type OKDefaults struct {
1793 When string `gae:"$when,tomorrow"` 1793 When string `gae:"$when,tomorrow"`
1794 Amount int64 `gae:"$amt,100"` 1794 Amount int64 `gae:"$amt,100"`
1795 } 1795 }
1796 pls := GetPLS(&OKDefaults{}) 1796 pls := GetPLS(&OKDefaults{})
1797 pm, err := pls.Save(true) 1797 pm, err := pls.Save(true)
1798 So(err, ShouldBeNil) 1798 So(err, ShouldBeNil)
1799 So(pm, ShouldResemble, PropertyMap{ 1799 So(pm, ShouldResemble, PropertyMap{
1800 "$when": {mpNI("tomorrow")}, 1800 "$when": {mpNI("tomorrow")},
1801 "$amt": {mpNI(100)}, 1801 "$amt": {mpNI(100)},
1802 "$kind": {mpNI("OKDefaults")},
1802 }) 1803 })
1803 1804
1804 v, err := pm.GetMeta("when") 1805 v, err := pm.GetMeta("when")
1805 So(err, ShouldBeNil) 1806 So(err, ShouldBeNil)
1806 So(v, ShouldEqual, "tomorrow") 1807 So(v, ShouldEqual, "tomorrow")
1807 1808
1808 v, err = pm.GetMeta("amt") 1809 v, err = pm.GetMeta("amt")
1809 So(err, ShouldBeNil) 1810 So(err, ShouldBeNil)
1810 So(v, ShouldEqual, int64(100)) 1811 So(v, ShouldEqual, int64(100))
1811 }) 1812 })
(...skipping 29 matching lines...) Expand all
1841 1842
1842 Convey("Bad default meta type", func() { 1843 Convey("Bad default meta type", func() {
1843 type BadDefault struct { 1844 type BadDefault struct {
1844 Val time.Time `gae:"$meta,tomorrow"` 1845 Val time.Time `gae:"$meta,tomorrow"`
1845 } 1846 }
1846 pls := GetPLS(&BadDefault{}) 1847 pls := GetPLS(&BadDefault{})
1847 So(pls.Problem().Error(), ShouldContainSubstring, "bad t ype") 1848 So(pls.Problem().Error(), ShouldContainSubstring, "bad t ype")
1848 }) 1849 })
1849 }) 1850 })
1850 } 1851 }
OLDNEW
« no previous file with comments | « service/datastore/pls_impl.go ('k') | service/datastore/properties.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698