| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/env python |
| 2 | |
| 3 # Copyright (c) 2011 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 4 # 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 |
| 5 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 6 | 5 |
| 7 """Tests for Constrained Network Server.""" | 6 """Tests for Constrained Network Server.""" |
| 8 import os | 7 import os |
| 9 import signal | 8 import signal |
| 10 import subprocess | 9 import subprocess |
| 11 import tempfile | 10 import tempfile |
| 12 import time | 11 import time |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 # Verify the request took longer than the requested latency. | 152 # Verify the request took longer than the requested latency. |
| 154 self.assertTrue(time.time() - now > self._LATENCY_TEST_SECS) | 153 self.assertTrue(time.time() - now > self._LATENCY_TEST_SECS) |
| 155 | 154 |
| 156 # Verify the server properly redirected the URL. | 155 # Verify the server properly redirected the URL. |
| 157 self.assertEquals(f.geturl(), base_url.replace( | 156 self.assertEquals(f.geturl(), base_url.replace( |
| 158 str(cns._DEFAULT_SERVING_PORT), str(cns._DEFAULT_CNS_PORT_RANGE[0]))) | 157 str(cns._DEFAULT_SERVING_PORT), str(cns._DEFAULT_CNS_PORT_RANGE[0]))) |
| 159 | 158 |
| 160 | 159 |
| 161 if __name__ == '__main__': | 160 if __name__ == '__main__': |
| 162 unittest.main() | 161 unittest.main() |
| OLD | NEW |