OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 import os | 6 import os |
7 import StringIO | 7 import StringIO |
8 import sys | 8 import sys |
9 | 9 |
10 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | 10 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 | 174 |
175 def testUpgradeToHttps(self): | 175 def testUpgradeToHttps(self): |
176 values = [ | 176 values = [ |
177 ['', ''], | 177 ['', ''], |
178 [None, None], | 178 [None, None], |
179 ['foo', 'https://foo'], | 179 ['foo', 'https://foo'], |
180 ['http://foo', 'https://foo'], | 180 ['http://foo', 'https://foo'], |
181 ['foo/', 'https://foo/'], | 181 ['foo/', 'https://foo/'], |
182 ['ssh-svn://foo', 'ssh-svn://foo'], | 182 ['ssh-svn://foo', 'ssh-svn://foo'], |
183 ['ssh-svn://foo/bar/', 'ssh-svn://foo/bar/'], | 183 ['ssh-svn://foo/bar/', 'ssh-svn://foo/bar/'], |
184 ['codereview.chromium.org', 'https://chromiumcodereview.appspot.com'], | 184 ['codereview.chromium.org', 'https://codereview.chromium.org'], |
185 ['codereview.chromium.org/', 'https://chromiumcodereview.appspot.com/'], | 185 ['codereview.chromium.org/', 'https://codereview.chromium.org/'], |
186 ['http://foo:8080', 'http://foo:8080'], | 186 ['http://foo:8080', 'http://foo:8080'], |
187 ['http://foo:8080/bar', 'http://foo:8080/bar'], | 187 ['http://foo:8080/bar', 'http://foo:8080/bar'], |
188 ['foo:8080', 'http://foo:8080'], | 188 ['foo:8080', 'http://foo:8080'], |
189 ['foo:', 'https://foo:'], | 189 ['foo:', 'https://foo:'], |
190 ] | 190 ] |
191 for content, expected in values: | 191 for content, expected in values: |
192 self.assertEquals( | 192 self.assertEquals( |
193 expected, gclient_utils.UpgradeToHttps(content)) | 193 expected, gclient_utils.UpgradeToHttps(content)) |
194 | 194 |
195 def testParseCodereviewSettingsContent(self): | 195 def testParseCodereviewSettingsContent(self): |
(...skipping 15 matching lines...) Expand all Loading... |
211 for content, expected in values: | 211 for content, expected in values: |
212 self.assertEquals( | 212 self.assertEquals( |
213 expected, gclient_utils.ParseCodereviewSettingsContent(content)) | 213 expected, gclient_utils.ParseCodereviewSettingsContent(content)) |
214 | 214 |
215 | 215 |
216 if __name__ == '__main__': | 216 if __name__ == '__main__': |
217 import unittest | 217 import unittest |
218 unittest.main() | 218 unittest.main() |
219 | 219 |
220 # vim: ts=2:sw=2:tw=80:et: | 220 # vim: ts=2:sw=2:tw=80:et: |
OLD | NEW |