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

Unified Diff: chrome/common/extensions/docs/server2/test_object_store_test.py

Issue 13470005: Refactor the devserver to make it easier to control caching (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cduvall, rebase Created 7 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/test_object_store_test.py
diff --git a/chrome/common/extensions/docs/server2/test_object_store_test.py b/chrome/common/extensions/docs/server2/test_object_store_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..448fce3f469c54963e6c075b647dcbc5582a84b5
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/test_object_store_test.py
@@ -0,0 +1,28 @@
+#!/usr/bin/env python
+# Copyright 2013 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.
+
+from test_object_store import TestObjectStore
+import unittest
+
+class TestObjectStoreTest(unittest.TestCase):
+ def testEmpty(self):
+ store = TestObjectStore('namespace')
+ self.assertEqual(None, store.Get('hi').Get())
+ self.assertEqual({}, store.GetMulti(['hi', 'lo']).Get())
+
+ def testNonEmpty(self):
+ store = TestObjectStore('namespace')
+ store.Set('hi', 'bye')
+ self.assertEqual('bye', store.Get('hi').Get())
+ self.assertEqual({'hi': 'bye'}, store.GetMulti(['hi', 'lo']).Get())
+ store.Set('hi', 'blah')
+ self.assertEqual('blah', store.Get('hi').Get())
+ self.assertEqual({'hi': 'blah'}, store.GetMulti(['hi', 'lo']).Get())
+ store.Delete('hi')
+ self.assertEqual(None, store.Get('hi').Get())
+ self.assertEqual({}, store.GetMulti(['hi', 'lo']).Get())
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « chrome/common/extensions/docs/server2/test_object_store.py ('k') | chrome/common/extensions/docs/server2/url_constants.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698