OLD | NEW |
1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import base64 | 5 import base64 |
6 import json | 6 import json |
7 import re | 7 import re |
8 import unittest | 8 import unittest |
9 | 9 |
10 from common import git_repository | 10 from common import git_repository |
(...skipping 13 matching lines...) Expand all Loading... |
24 "parents": [ | 24 "parents": [ |
25 "42a94bb5e2ef8525d7dadbd8eae37fe7cb8d77d0" | 25 "42a94bb5e2ef8525d7dadbd8eae37fe7cb8d77d0" |
26 ], | 26 ], |
27 "author": { | 27 "author": { |
28 "name": "malch@chromium.org", | 28 "name": "malch@chromium.org", |
29 "email": "malch@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538", | 29 "email": "malch@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538", |
30 "time": "Wed Jun 11 19:35:32 2014" | 30 "time": "Wed Jun 11 19:35:32 2014" |
31 }, | 31 }, |
32 "committer": { | 32 "committer": { |
33 "name": "malch@chromium.org", | 33 "name": "malch@chromium.org", |
34 "email": "malch@chromium.org@bbb929c8-8fbe-4397-9dbb-9b2b20218538", | 34 "email": "malch@chromium.org", |
35 "time": "Wed Jun 11 19:35:32 2014" | 35 "time": "Wed Jun 11 19:35:32 2014" |
36 }, | 36 }, |
37 "message": %s, | 37 "message": %s, |
38 "tree_diff": [ | 38 "tree_diff": [ |
39 { | 39 { |
40 "type": "add", | 40 "type": "add", |
41 "old_id": "f71f1167c2204626057d26912b8a2ff096fe4bd2", | 41 "old_id": "f71f1167c2204626057d26912b8a2ff096fe4bd2", |
42 "old_mode": 33188, | 42 "old_mode": 33188, |
43 "old_path": "/dev/null", | 43 "old_path": "/dev/null", |
44 "new_id": "165fb11e0658f41d66038199056a53bcfab5dda0", | 44 "new_id": "165fb11e0658f41d66038199056a53bcfab5dda0", |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 self.assertIsNone(self.git_repo.GetSource('path', 'not_existing_revision')) | 377 self.assertIsNone(self.git_repo.GetSource('path', 'not_existing_revision')) |
378 | 378 |
379 path = 'a/b/c.cc' | 379 path = 'a/b/c.cc' |
380 git_revision = 'dummy_abcd1234' | 380 git_revision = 'dummy_abcd1234' |
381 original_source = 'dummy source' | 381 original_source = 'dummy source' |
382 self.http_client_for_git.SetResponseForUrl( | 382 self.http_client_for_git.SetResponseForUrl( |
383 '%s/+/%s/%s?format=text' % (self.repo_url, git_revision, path), | 383 '%s/+/%s/%s?format=text' % (self.repo_url, git_revision, path), |
384 base64.b64encode(original_source)) | 384 base64.b64encode(original_source)) |
385 source = self.git_repo.GetSource(path, git_revision) | 385 source = self.git_repo.GetSource(path, git_revision) |
386 self.assertEqual(original_source, source) | 386 self.assertEqual(original_source, source) |
OLD | NEW |