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

Side by Side Diff: appengine/findit/gae_libs/model/test/versioned_model_test.py

Issue 2488113005: [Findit] Re-org code. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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
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 from google.appengine.api import datastore_errors 5 from google.appengine.api import datastore_errors
6 from google.appengine.ext import ndb 6 from google.appengine.ext import ndb
7 7
8 from testing_utils import testing 8 from testing_utils import testing
9 9
10 from model.versioned_model import VersionedModel 10 from gae_libs.model.versioned_model import VersionedModel
11 11
12 12
13 class _Entity(VersionedModel): 13 class _Entity(VersionedModel):
14 value = ndb.IntegerProperty(indexed=False) 14 value = ndb.IntegerProperty(indexed=False)
15 15
16 16
17 class VersionedModelTest(testing.AppengineTestCase): 17 class VersionedModelTest(testing.AppengineTestCase):
18 18
19 def testGetRootModel(self): 19 def testGetRootModel(self):
20 root_model_class = _Entity._GetRootModel() 20 root_model_class = _Entity._GetRootModel()
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 raise datastore_errors.BadRequestError() 191 raise datastore_errors.BadRequestError()
192 return original_ndb_transaction(func, **options) 192 return original_ndb_transaction(func, **options)
193 self.mock(ndb, 'transaction', MockNdbTransaction) 193 self.mock(ndb, 'transaction', MockNdbTransaction)
194 194
195 entity = _Entity.Create() 195 entity = _Entity.Create()
196 key, saved = entity.Save() 196 key, saved = entity.Save()
197 expected_key = ndb.Key('_EntityRoot', 1, '_Entity', 1) 197 expected_key = ndb.Key('_EntityRoot', 1, '_Entity', 1)
198 self.assertEqual(expected_key, key) 198 self.assertEqual(expected_key, key)
199 self.assertEqual([1], calls) 199 self.assertEqual([1], calls)
200 self.assertTrue(saved) 200 self.assertTrue(saved)
OLDNEW
« no previous file with comments | « appengine/findit/gae_libs/model/test/versioned_config_test.py ('k') | appengine/findit/gae_libs/model/versioned_config.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698