Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: autoupdate_unittest.py

Issue 5611004: Add support for --proxy_port. (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/dev-util.git@master
Patch Set: Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « autoupdate.py ('k') | devserver.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved. 3 # Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Unit tests for autoupdate.py.""" 7 """Unit tests for autoupdate.py."""
8 8
9 import cherrypy 9 import cherrypy
10 import mox 10 import mox
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 self.static_image_dir, 'update.gz')).AndReturn(self.size) 117 self.static_image_dir, 'update.gz')).AndReturn(self.size)
118 autoupdate.Autoupdate.GetUpdatePayload( 118 autoupdate.Autoupdate.GetUpdatePayload(
119 self.hash, self.sha256, self.size, self.url, False).AndReturn( 119 self.hash, self.sha256, self.size, self.url, False).AndReturn(
120 self.payload) 120 self.payload)
121 121
122 self.mox.ReplayAll() 122 self.mox.ReplayAll()
123 au_mock = self._DummyAutoupdateConstructor() 123 au_mock = self._DummyAutoupdateConstructor()
124 self.assertEqual(au_mock.HandleUpdatePing(test_data), self.payload) 124 self.assertEqual(au_mock.HandleUpdatePing(test_data), self.payload)
125 self.mox.VerifyAll() 125 self.mox.VerifyAll()
126 126
127 def testChangeUrlPort(self):
128 r = autoupdate._ChangeUrlPort('http://fuzzy:8080/static', 8085)
129 self.assertEqual(r, 'http://fuzzy:8085/static')
130
131 r = autoupdate._ChangeUrlPort('http://fuzzy/static', 8085)
132 self.assertEqual(r, 'http://fuzzy:8085/static')
133
134 r = autoupdate._ChangeUrlPort('ftp://fuzzy/static', 8085)
135 self.assertEqual(r, 'ftp://fuzzy:8085/static')
136
137 r = autoupdate._ChangeUrlPort('ftp://fuzzy', 8085)
138 self.assertEqual(r, 'ftp://fuzzy:8085')
139
127 140
128 if __name__ == '__main__': 141 if __name__ == '__main__':
129 unittest.main() 142 unittest.main()
OLDNEW
« no previous file with comments | « autoupdate.py ('k') | devserver.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698