OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 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 unittest | 5 import unittest |
6 | 6 |
7 from common.change_log import FileChangeInfo | 7 from lib.gitiles.change_log import FileChangeInfo, ChangeLog |
8 from common.change_log import ChangeLog | |
9 | 8 |
10 class ChangeLogTest(unittest.TestCase): | 9 class ChangeLogTest(unittest.TestCase): |
11 def testFileChangeinfo(self): | 10 def testFileChangeinfo(self): |
12 filechange_dict = { | 11 filechange_dict = { |
13 'change_type': 'copy', | 12 'change_type': 'copy', |
14 'old_path': 'a', | 13 'old_path': 'a', |
15 'new_path': 'b' | 14 'new_path': 'b' |
16 } | 15 } |
17 filechange_info = FileChangeInfo.FromDict(filechange_dict) | 16 filechange_info = FileChangeInfo.FromDict(filechange_dict) |
18 self.assertEqual(filechange_dict, filechange_info.ToDict()) | 17 self.assertEqual(filechange_dict, filechange_info.ToDict()) |
(...skipping 21 matching lines...) Expand all Loading... |
40 } | 39 } |
41 ], | 40 ], |
42 'message': 'blabla...', | 41 'message': 'blabla...', |
43 'commit_url': 'https://chromium.googlesource.com/chromium/src/+/git_hash', | 42 'commit_url': 'https://chromium.googlesource.com/chromium/src/+/git_hash', |
44 'code_review_url': 'https://codereview.chromium.org/2222', | 43 'code_review_url': 'https://codereview.chromium.org/2222', |
45 'reverted_revision': '8d4a4fa6s18raf3re12tg6r' | 44 'reverted_revision': '8d4a4fa6s18raf3re12tg6r' |
46 } | 45 } |
47 | 46 |
48 change_log = ChangeLog.FromDict(change_log_dict) | 47 change_log = ChangeLog.FromDict(change_log_dict) |
49 self.assertEqual(change_log_dict, change_log.ToDict()) | 48 self.assertEqual(change_log_dict, change_log.ToDict()) |
OLD | NEW |