OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Unit tests for gclient.py. | 6 """Unit tests for gclient.py. |
7 | 7 |
8 See gclient_smoketest.py for integration tests. | 8 See gclient_smoketest.py for integration tests. |
9 """ | 9 """ |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 def _get_processed(self): | 175 def _get_processed(self): |
176 items = [] | 176 items = [] |
177 try: | 177 try: |
178 while True: | 178 while True: |
179 items.append(self.processed.get_nowait()) | 179 items.append(self.processed.get_nowait()) |
180 except Queue.Empty: | 180 except Queue.Empty: |
181 pass | 181 pass |
182 return items | 182 return items |
183 | 183 |
| 184 def testAutofix(self): |
| 185 # Invalid urls causes pain when specifying requirements. Make sure it's |
| 186 # auto-fixed. |
| 187 d = gclient.Dependency( |
| 188 None, 'name', 'proto://host/path/@revision', None, None, |
| 189 None, '', True) |
| 190 self.assertEquals('proto://host/path@revision', d.url) |
184 | 191 |
185 if __name__ == '__main__': | 192 if __name__ == '__main__': |
186 logging.basicConfig( | 193 logging.basicConfig( |
187 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ | 194 level=[logging.ERROR, logging.WARNING, logging.INFO, logging.DEBUG][ |
188 min(sys.argv.count('-v'), 3)], | 195 min(sys.argv.count('-v'), 3)], |
189 format='%(asctime).19s %(levelname)s %(filename)s:' | 196 format='%(asctime).19s %(levelname)s %(filename)s:' |
190 '%(lineno)s %(message)s') | 197 '%(lineno)s %(message)s') |
191 unittest.main() | 198 unittest.main() |
OLD | NEW |