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

Unified Diff: tests/gclient_utils_test.py

Issue 9214002: Dedupe codereview.settings parsing code. Add more testing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 8 years, 11 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 | « git_cl.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/gclient_utils_test.py
diff --git a/tests/gclient_utils_test.py b/tests/gclient_utils_test.py
index 023f7e979862355498cb9ba0b554067615b4d767..7180d961abdeca2d34f0697a7913c95f4f02160f 100755
--- a/tests/gclient_utils_test.py
+++ b/tests/gclient_utils_test.py
@@ -33,7 +33,8 @@ class GclientUtilsUnittest(GclientUtilBase):
'FileWrite', 'FindFileUpwards', 'FindGclientRoot',
'GetGClientRootAndEntries', 'GetEditor', 'IsDateRevision',
'MakeDateRevision', 'MakeFileAutoFlush', 'MakeFileAnnotated',
- 'PathDifference', 'PrintableObject', 'RemoveDirectory', 'RunEditor',
+ 'PathDifference', 'ParseCodereviewSettingsContent',
+ 'PrintableObject', 'RemoveDirectory', 'RunEditor',
'SplitUrlRevision', 'SyntaxErrorToError', 'Wrapper', 'WorkItem',
'errno', 'lockedmethod', 'logging', 'os', 'Queue', 're', 'rmtree',
'safe_makedirs', 'stat', 'subprocess2', 'sys', 'tempfile', 'threading',
@@ -170,6 +171,21 @@ class GClientUtilsTest(trial_dir.TestCase):
os.chmod(l2, 0)
os.chmod(l1, 0)
+ def testParseCodereviewSettingsContent(self):
+ expected = {
+ 'Foo': 'bar:baz',
+ 'Second': 'value',
+ }
+ content = (
+ '# bleh\n'
+ '\t# foo : bar\n'
+ 'Foo:bar:baz\n'
+ ' Second : value \n\r'
+ '#inconsistency'
+ )
+ self.assertEquals(
+ expected, gclient_utils.ParseCodereviewSettingsContent(content))
+
if __name__ == '__main__':
import unittest
« no previous file with comments | « git_cl.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698