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

Unified Diff: tests/rietveld_test.py

Issue 6874006: Add support for A+ files. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: . Created 9 years, 3 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 | « tests/patch_test.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 5412cf26cc10112b99b00e2b763b78477e496f89..7551e4b803201bbf0e671c7f3ef09d646a97398d 100755
--- a/tests/rietveld_test.py
+++ b/tests/rietveld_test.py
@@ -288,6 +288,38 @@ class RietveldTest(unittest.TestCase):
# TODO(maruel): Change with no diff, only svn property change:
# http://codereview.chromium.org/6462019/
+ def test_get_patch_moved(self):
+ output = (
+ '{\n'
+ ' "files":\n'
+ ' {\n'
+ ' "file_a":\n'
+ ' {\n'
+ ' "status": "A+",\n'
+ ' "is_binary": false,\n'
+ ' "num_chunks": 1,\n'
+ ' "id": 789\n'
+ ' }\n'
+ ' }\n'
+ '}\n')
+ diff = (
+ '--- /dev/null\n'
+ '+++ file_a\n'
+ '@@ -0,0 +1 @@\n'
+ '+foo\n')
+ r = rietveld.Rietveld('url', 'email', 'password')
+ def _send(args, **kwargs):
+ if args == '/api/123/456':
+ return output
+ elif args == '/download/issue123_456_789.diff':
+ return diff
+ else:
+ self.fail()
+ r._send = _send
+ patches = r.get_patch(123, 456)
+ self.assertEquals(diff, patches.patches[0].get())
+ self.assertEquals([], patches.patches[0].svn_properties)
+
if __name__ == '__main__':
logging.basicConfig(level=logging.ERROR)
« no previous file with comments | « tests/patch_test.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698