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

Unified 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: rebase 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/docs/server2/path_util_test.py
diff --git a/chrome/common/extensions/docs/server2/path_util_test.py b/chrome/common/extensions/docs/server2/path_util_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..26527a06ad1d16a71bbd069cd84c21a80642ef42
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/path_util_test.py
@@ -0,0 +1,29 @@
+#!/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.
+
+import unittest
+
+from path_util import SplitParent
+
+
+class PathUtilTest(unittest.TestCase):
+
+ def testSplitParent(self):
+ self.assertEqual(('', 'hi'), SplitParent('hi'))
+ self.assertEqual(('', 'hi/'), SplitParent('hi/'))
+ self.assertEqual(('/', 'hi'), SplitParent('/hi'))
+ self.assertEqual(('/', 'hi/'), SplitParent('/hi/'))
+ self.assertEqual(('parent', 'hi'), SplitParent('parent/hi'))
+ self.assertEqual(('parent', 'hi/'), SplitParent('parent/hi/'))
+ self.assertEqual(('/parent', 'hi'), SplitParent('/parent/hi'))
+ self.assertEqual(('/parent', 'hi/'), SplitParent('/parent/hi/'))
+ self.assertEqual(('p1/p2', 'hi'), SplitParent('p1/p2/hi'))
+ self.assertEqual(('p1/p2', 'hi/'), SplitParent('p1/p2/hi/'))
+ self.assertEqual(('/p1/p2', 'hi'), SplitParent('/p1/p2/hi'))
+ self.assertEqual(('/p1/p2', 'hi/'), SplitParent('/p1/p2/hi/'))
+
+
+if __name__ == '__main__':
+ unittest.main()
« no previous file with comments | « chrome/common/extensions/docs/server2/path_util.py ('k') | chrome/common/extensions/docs/server2/render_servlet.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698