| 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, DependencyRoll |
| 8 from common.dependency import DependencyRoll | |
| 9 | 8 |
| 10 | 9 |
| 11 class DependencyTest(unittest.TestCase): | 10 class DependencyTest(unittest.TestCase): |
| 12 def testParentChild(self): | 11 def testParentChild(self): |
| 13 parent = Dependency( | 12 parent = Dependency( |
| 14 'a/', 'https://cr.googlesource.com/cr/a.git', '12a', 'DEPS') | 13 'a/', 'https://cr.googlesource.com/cr/a.git', '12a', 'DEPS') |
| 15 child = Dependency( | 14 child = Dependency( |
| 16 'a/b/', 'https://cr.googlesource.com/cr/b.git', '12b', 'DEPS') | 15 'a/b/', 'https://cr.googlesource.com/cr/b.git', '12b', 'DEPS') |
| 17 | 16 |
| 18 child.SetParent(parent) | 17 child.SetParent(parent) |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 'third_party/dep/', 'https://cr.googlesource.com/cr/dep.git', | 59 'third_party/dep/', 'https://cr.googlesource.com/cr/dep.git', |
| 61 'rev1', 'rev2') | 60 'rev1', 'rev2') |
| 62 expected_dep_roll_dict = { | 61 expected_dep_roll_dict = { |
| 63 'path': 'third_party/dep/', | 62 'path': 'third_party/dep/', |
| 64 'repo_url': 'https://cr.googlesource.com/cr/dep.git', | 63 'repo_url': 'https://cr.googlesource.com/cr/dep.git', |
| 65 'old_revision': 'rev1', | 64 'old_revision': 'rev1', |
| 66 'new_revision': 'rev2', | 65 'new_revision': 'rev2', |
| 67 } | 66 } |
| 68 | 67 |
| 69 self.assertEqual(expected_dep_roll_dict, dep_roll.ToDict()) | 68 self.assertEqual(expected_dep_roll_dict, dep_roll.ToDict()) |
| OLD | NEW |