OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 # Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license | 4 # Use of this source code is governed by a BSD-style license |
5 # that can be found in the LICENSE file in the root of the source | 5 # that can be found in the LICENSE file in the root of the source |
6 # tree. An additional intellectual property rights grant can be found | 6 # tree. An additional intellectual property rights grant can be found |
7 # in the file PATENTS. All contributing project authors may | 7 # in the file PATENTS. All contributing project authors may |
8 # be found in the AUTHORS file in the root of the source tree. | 8 # be found in the AUTHORS file in the root of the source tree. |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 def testParseDepsDict(self): | 100 def testParseDepsDict(self): |
101 with open(self._webrtc_depsfile) as deps_file: | 101 with open(self._webrtc_depsfile) as deps_file: |
102 deps_contents = deps_file.read() | 102 deps_contents = deps_file.read() |
103 local_scope = ParseDepsDict(deps_contents) | 103 local_scope = ParseDepsDict(deps_contents) |
104 vars_dict = local_scope['vars'] | 104 vars_dict = local_scope['vars'] |
105 | 105 |
106 def AssertVar(variable_name): | 106 def AssertVar(variable_name): |
107 self.assertEquals(vars_dict[variable_name], TEST_DATA_VARS[variable_name]) | 107 self.assertEquals(vars_dict[variable_name], TEST_DATA_VARS[variable_name]) |
108 AssertVar('chromium_git') | 108 AssertVar('chromium_git') |
109 AssertVar('chromium_revision') | 109 AssertVar('chromium_revision') |
110 self.assertEquals(len(local_scope['deps']), 3) | 110 self.assertEquals(len(local_scope['deps']), 2) |
111 self.assertEquals(len(local_scope['deps_os']), 1) | 111 self.assertEquals(len(local_scope['deps_os']), 1) |
112 | 112 |
113 def testGetMatchingDepsEntriesReturnsPathInSimpleCase(self): | 113 def testGetMatchingDepsEntriesReturnsPathInSimpleCase(self): |
114 entries = GetMatchingDepsEntries(DEPS_ENTRIES, 'src/testing/gtest') | 114 entries = GetMatchingDepsEntries(DEPS_ENTRIES, 'src/testing/gtest') |
115 self.assertEquals(len(entries), 1) | 115 self.assertEquals(len(entries), 1) |
116 self.assertEquals(entries[0], DEPS_ENTRIES['src/testing/gtest']) | 116 self.assertEquals(entries[0], DEPS_ENTRIES['src/testing/gtest']) |
117 | 117 |
118 def testGetMatchingDepsEntriesHandlesSimilarStartingPaths(self): | 118 def testGetMatchingDepsEntriesHandlesSimilarStartingPaths(self): |
119 entries = GetMatchingDepsEntries(DEPS_ENTRIES, 'src/testing') | 119 entries = GetMatchingDepsEntries(DEPS_ENTRIES, 'src/testing') |
120 self.assertEquals(len(entries), 2) | 120 self.assertEquals(len(entries), 2) |
(...skipping 19 matching lines...) Expand all Loading... |
140 self.assertEquals(changed_deps[1].new_rev, BUILDTOOLS_NEW_REV) | 140 self.assertEquals(changed_deps[1].new_rev, BUILDTOOLS_NEW_REV) |
141 | 141 |
142 | 142 |
143 def _SetupGitLsRemoteCall(cmd_fake, url, revision): | 143 def _SetupGitLsRemoteCall(cmd_fake, url, revision): |
144 cmd = ['git', 'ls-remote', url, revision] | 144 cmd = ['git', 'ls-remote', url, revision] |
145 cmd_fake.AddExpectation(cmd, _returns=(revision, None)) | 145 cmd_fake.AddExpectation(cmd, _returns=(revision, None)) |
146 | 146 |
147 | 147 |
148 if __name__ == '__main__': | 148 if __name__ == '__main__': |
149 unittest.main() | 149 unittest.main() |
OLD | NEW |