OLD | NEW |
| (Empty) |
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 | |
3 # found in the LICENSE file. | |
4 | |
5 import unittest | |
6 | |
7 from common.change_log import FileChangeInfo | |
8 from common.change_log import ChangeLog | |
9 | |
10 class ChangeLogTest(unittest.TestCase): | |
11 def testFileChangeinfo(self): | |
12 filechange_dict = { | |
13 'change_type': 'copy', | |
14 'old_path': 'a', | |
15 'new_path': 'b' | |
16 } | |
17 filechange_info = FileChangeInfo.FromDict(filechange_dict) | |
18 self.assertEqual(filechange_dict, filechange_info.ToDict()) | |
19 | |
20 def testChangeLog(self): | |
21 change_log_dict = { | |
22 'author_name': 'a', | |
23 'author_email': 'b@email.com', | |
24 'author_time': '2014-08-13 00:53:12', | |
25 'committer_name': 'c', | |
26 'committer_email': 'd@email.com', | |
27 'committer_time': '2014-08-14 00:53:12', | |
28 'revision': 'aaaa', | |
29 'commit_position': 1111, | |
30 'touched_files': [ | |
31 { | |
32 'change_type': 'copy', | |
33 'old_path': 'old_file', | |
34 'new_path': 'new_file' | |
35 }, | |
36 { | |
37 'change_type': 'modify', | |
38 'old_path': 'file', | |
39 'new_path': 'file' | |
40 } | |
41 ], | |
42 'message': 'blabla...', | |
43 'commit_url': 'https://chromium.googlesource.com/chromium/src/+/git_hash', | |
44 'code_review_url': 'https://codereview.chromium.org/2222', | |
45 'reverted_revision': '8d4a4fa6s18raf3re12tg6r' | |
46 } | |
47 | |
48 change_log = ChangeLog.FromDict(change_log_dict) | |
49 self.assertEqual(change_log_dict, change_log.ToDict()) | |
OLD | NEW |