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

Unified Diff: tests/filesystem_mock.py

Issue 6627059: make tests work, implement 'set noparent', owners propagating down (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: update w/ review feedback from maruel Created 9 years, 9 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
« no previous file with comments | « owners.py ('k') | tests/owners_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/filesystem_mock.py
diff --git a/tests/filesystem_mock.py b/tests/filesystem_mock.py
index 6ce656110942e3027b7237021532a9108f73c348..f8a3a1d87ddc7b65756ddababcef17c0409e009c 100644
--- a/tests/filesystem_mock.py
+++ b/tests/filesystem_mock.py
@@ -32,10 +32,15 @@ class MockFileSystem(object):
def _split(self, path):
return path.rsplit(self.sep, 1)
+ def abspath(self, path):
+ if path.endswith(self.sep):
+ return path[:-1]
+ return path
+
def dirname(self, path):
- if not self.sep in path:
+ if self.sep not in path:
return ''
- return self._split(path)[0]
+ return self._split(path)[0] or self.sep
def exists(self, path):
return self.isfile(path) or self.isdir(path)
@@ -56,7 +61,7 @@ class MockFileSystem(object):
return any(f.startswith(path) for f in files)
def join(self, *comps):
- # FIXME: might want tests for this and/or a better comment about how
+ # TODO: Might want tests for this and/or a better comment about how
# it works.
return re.sub(re.escape(os.path.sep), self.sep, os.path.join(*comps))
« no previous file with comments | « owners.py ('k') | tests/owners_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698