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

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

Issue 149513014: Docserver: Add FileSystem.Exists method and start sanity checking path format (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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 2013 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 unittest
7
8 from path_util import SplitParent
9
10
11 class PathUtilTest(unittest.TestCase):
12
13 def testSplitParent(self):
14 self.assertEqual(('', 'hi'), SplitParent('hi'))
15 self.assertEqual(('', 'hi/'), SplitParent('hi/'))
16 self.assertEqual(('/', 'hi'), SplitParent('/hi'))
17 self.assertEqual(('/', 'hi/'), SplitParent('/hi/'))
18 self.assertEqual(('parent', 'hi'), SplitParent('parent/hi'))
19 self.assertEqual(('parent', 'hi/'), SplitParent('parent/hi/'))
20 self.assertEqual(('/parent', 'hi'), SplitParent('/parent/hi'))
21 self.assertEqual(('/parent', 'hi/'), SplitParent('/parent/hi/'))
22 self.assertEqual(('p1/p2', 'hi'), SplitParent('p1/p2/hi'))
23 self.assertEqual(('p1/p2', 'hi/'), SplitParent('p1/p2/hi/'))
24 self.assertEqual(('/p1/p2', 'hi'), SplitParent('/p1/p2/hi'))
25 self.assertEqual(('/p1/p2', 'hi/'), SplitParent('/p1/p2/hi/'))
26
27
28 if __name__ == '__main__':
29 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698