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

Unified Diff: tests/rietveld_test.py

Issue 7776015: Implement reverse mangling of svn properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Clarify text, use more named variables Created 9 years, 4 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 | « rietveld.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/rietveld_test.py
diff --git a/tests/rietveld_test.py b/tests/rietveld_test.py
index 6c81454ac83f1ee5f5c0be66ce117450438a58b5..ab84a375bd8d5c566c492618aab8cf2bb423671f 100755
--- a/tests/rietveld_test.py
+++ b/tests/rietveld_test.py
@@ -73,6 +73,43 @@ class RietveldTest(unittest.TestCase):
# This is because Rietveld._send() always returns the same buffer.
self.assertEquals(output, obj.get())
+ def testSvnProperties(self):
+ # Line too long (N/80)
+ # pylint: disable=C0301
+
+ # To test one of these, run something like
+ # import json, pprint, urllib
+ # url = 'http://codereview.chromium.org/api/202046/1'
+ # pprint.pprint(json.load(urllib.urlopen(url))['files'])
+
+ # svn:mergeinfo across branches:
+ # http://codereview.chromium.org/202046/diff/1/third_party/libxml/xmlcatalog_dummy.cc
+ self.assertEquals(
+ [('svn:eol-style', 'LF')],
+ rietveld.Rietveld.parse_svn_properties(
+ u'\nAdded: svn:eol-style\n + LF\n', 'foo'))
+
+ # svn:eol-style property that is lost in the diff
+ # http://codereview.chromium.org/202046/diff/1/third_party/libxml/xmllint_dummy.cc
+ self.assertEquals(
+ [],
+ rietveld.Rietveld.parse_svn_properties(
+ u'\nAdded: svn:mergeinfo\n'
+ ' Merged /branches/chrome_webkit_merge_branch/third_party/'
+ 'libxml/xmldummy_mac.cc:r69-2775\n',
+ 'foo'))
+
+ self.assertEquals(
+ [],
+ rietveld.Rietveld.parse_svn_properties(u'', 'foo'))
+
+ try:
+ rietveld.Rietveld.parse_svn_properties(u'\n', 'foo')
+ self.fail()
+ except rietveld.patch.UnsupportedPatchFormat, e:
+ self.assertEquals('foo', e.filename)
+ # TODO(maruel): Change with no diff, only svn property change:
+ # http://codereview.chromium.org/6462019/
if __name__ == '__main__':
« no previous file with comments | « rietveld.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698