| 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.dependency import Dependency | 7 from common.dependency import Dependency |
| 8 from common.dependency import DependencyRoll | 8 from common.dependency import DependencyRoll |
| 9 | 9 |
| 10 | 10 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 'deps_file': 'DEPS', | 38 'deps_file': 'DEPS', |
| 39 'children': { | 39 'children': { |
| 40 } | 40 } |
| 41 } | 41 } |
| 42 } | 42 } |
| 43 } | 43 } |
| 44 | 44 |
| 45 sub_dep.SetParent(root_dep) | 45 sub_dep.SetParent(root_dep) |
| 46 self.assertEqual(expected_dep_tree_dict, root_dep.ToDict()) | 46 self.assertEqual(expected_dep_tree_dict, root_dep.ToDict()) |
| 47 | 47 |
| 48 def testDependencyForChromeVersion(self): |
| 49 dep = Dependency( |
| 50 'a/b/', 'https://cr.googlesource.com/cr/b.git', '12b', 'DEPS', |
| 51 deps_repo_url='https://chrome-internal', deps_repo_revision='master') |
| 52 |
| 53 self.assertEqual(dep.deps_repo_url, 'https://chrome-internal') |
| 54 self.assertEqual(dep.deps_repo_revision, 'master') |
| 55 |
| 48 | 56 |
| 49 class DependencyRollTest(unittest.TestCase): | 57 class DependencyRollTest(unittest.TestCase): |
| 50 def testToDict(self): | 58 def testToDict(self): |
| 51 dep_roll = DependencyRoll( | 59 dep_roll = DependencyRoll( |
| 52 'third_party/dep/', 'https://cr.googlesource.com/cr/dep.git', | 60 'third_party/dep/', 'https://cr.googlesource.com/cr/dep.git', |
| 53 'rev1', 'rev2') | 61 'rev1', 'rev2') |
| 54 expected_dep_roll_dict = { | 62 expected_dep_roll_dict = { |
| 55 'path': 'third_party/dep/', | 63 'path': 'third_party/dep/', |
| 56 'repo_url': 'https://cr.googlesource.com/cr/dep.git', | 64 'repo_url': 'https://cr.googlesource.com/cr/dep.git', |
| 57 'old_revision': 'rev1', | 65 'old_revision': 'rev1', |
| 58 'new_revision': 'rev2', | 66 'new_revision': 'rev2', |
| 59 } | 67 } |
| 60 | 68 |
| 61 self.assertEqual(expected_dep_roll_dict, dep_roll.ToDict()) | 69 self.assertEqual(expected_dep_roll_dict, dep_roll.ToDict()) |
| OLD | NEW |