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

Unified Diff: testing_support/filesystem_mock.py

Issue 2148683003: Fix relative file: paths in OWNERS with roots other than '/' (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Created 4 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 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: testing_support/filesystem_mock.py
diff --git a/testing_support/filesystem_mock.py b/testing_support/filesystem_mock.py
index b45ea8e37409a766009e1afbb4e10b0dad357a3b..7a44dabb3287b3b44708bfb68aa3aa3d03ff6232 100644
--- a/testing_support/filesystem_mock.py
+++ b/testing_support/filesystem_mock.py
@@ -86,9 +86,9 @@ class MockFileSystem(object):
_RaiseNotFound(path)
return self.files[path]
- @staticmethod
- def relpath(path, base):
+ def relpath(self, path, base):
# This implementation is wrong in many ways; assert to check them for now.
+ if not base.endswith(self.sep):
+ base += self.sep
assert path.startswith(base)
- assert base.endswith('/')
return path[len(base):]
« 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