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

Side by Side Diff: chrome/common/extensions/docs/server2/memcache_file_system_test.py

Issue 10704252: Extensions Docs Server: Internal file system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: memcache fix Created 8 years, 5 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import unittest
8
9 import appengine_memcache as memcache
10 from in_memory_memcache import InMemoryMemcache
11 from local_file_system import LocalFileSystem
12 from memcache_file_system import MemcacheFileSystem
13
14 class LocalFileSystemTest(unittest.TestCase):
15 def setUp(self):
16 self._file_system = MemcacheFileSystem(
17 LocalFileSystem(os.path.join('test_data', 'file_system')),
18 InMemoryMemcache())
19
20 def testReadFiles(self):
21 expected = {
22 'test1.txt': 'test1\n',
23 'test2.txt': 'test2\n',
24 'test3.txt': 'test3\n',
25 }
26 self.assertEqual(
27 expected,
28 self._file_system.Read(['test1.txt', 'test2.txt', 'test3.txt']).Get())
29
30 def testListDir(self):
31 expected = ['dir/']
32 for i in range(7):
33 expected.append('file%d.html' % i)
34 self.assertEqual(
35 expected,
36 sorted(self._file_system.Read(['list/']).Get()['list/']))
37 (self._file_system._memcache._cache[memcache.MEMCACHE_FILE_SYSTEM_READ]
not at google - send to devlin 2012/07/19 03:55:19 Shoudn't need to access local variables like this.
cduvall 2012/07/19 17:18:28 Done.
38 ['list/'][0].remove('file0.html'))
39 expected.remove('file0.html')
40 self.assertEqual(
41 expected,
42 sorted(self._file_system.Read(['list/']).Get()['list/']))
43
not at google - send to devlin 2012/07/19 03:55:19 In any case, these tests don't really test the poi
cduvall 2012/07/19 17:18:28 Ok, sounds good.
44 if __name__ == '__main__':
45 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698