| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # | 2 # |
| 3 # Redistribution and use in source and binary forms, with or without | 3 # Redistribution and use in source and binary forms, with or without |
| 4 # modification, are permitted provided that the following conditions are | 4 # modification, are permitted provided that the following conditions are |
| 5 # met: | 5 # met: |
| 6 # | 6 # |
| 7 # * Redistributions of source code must retain the above copyright | 7 # * Redistributions of source code must retain the above copyright |
| 8 # notice, this list of conditions and the following disclaimer. | 8 # notice, this list of conditions and the following disclaimer. |
| 9 # * Redistributions in binary form must reproduce the above | 9 # * Redistributions in binary form must reproduce the above |
| 10 # copyright notice, this list of conditions and the following disclaimer | 10 # copyright notice, this list of conditions and the following disclaimer |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 def test_http_server_supports_ipv6(self): | 325 def test_http_server_supports_ipv6(self): |
| 326 port = self.make_port() | 326 port = self.make_port() |
| 327 self.assertTrue(port.http_server_supports_ipv6()) | 327 self.assertTrue(port.http_server_supports_ipv6()) |
| 328 port.host.platform.os_name = 'cygwin' | 328 port.host.platform.os_name = 'cygwin' |
| 329 self.assertFalse(port.http_server_supports_ipv6()) | 329 self.assertFalse(port.http_server_supports_ipv6()) |
| 330 port.host.platform.os_name = 'win' | 330 port.host.platform.os_name = 'win' |
| 331 self.assertTrue(port.http_server_supports_ipv6()) | 331 self.assertTrue(port.http_server_supports_ipv6()) |
| 332 | 332 |
| 333 def test_check_httpd_success(self): | 333 def test_check_httpd_success(self): |
| 334 port = self.make_port(executive=MockExecutive2()) | 334 port = self.make_port(executive=MockExecutive2()) |
| 335 port._path_to_apache = lambda: '/usr/sbin/httpd' | 335 port.path_to_apache = lambda: '/usr/sbin/httpd' |
| 336 capture = OutputCapture() | 336 capture = OutputCapture() |
| 337 capture.capture_output() | 337 capture.capture_output() |
| 338 self.assertTrue(port.check_httpd()) | 338 self.assertTrue(port.check_httpd()) |
| 339 _, _, logs = capture.restore_output() | 339 _, _, logs = capture.restore_output() |
| 340 self.assertEqual('', logs) | 340 self.assertEqual('', logs) |
| 341 | 341 |
| 342 def test_httpd_returns_error_code(self): | 342 def test_httpd_returns_error_code(self): |
| 343 port = self.make_port(executive=MockExecutive2(exit_code=1)) | 343 port = self.make_port(executive=MockExecutive2(exit_code=1)) |
| 344 port._path_to_apache = lambda: '/usr/sbin/httpd' | 344 port.path_to_apache = lambda: '/usr/sbin/httpd' |
| 345 capture = OutputCapture() | 345 capture = OutputCapture() |
| 346 capture.capture_output() | 346 capture.capture_output() |
| 347 self.assertFalse(port.check_httpd()) | 347 self.assertFalse(port.check_httpd()) |
| 348 _, _, logs = capture.restore_output() | 348 _, _, logs = capture.restore_output() |
| 349 self.assertEqual('httpd seems broken. Cannot run http tests.\n', logs) | 349 self.assertEqual('httpd seems broken. Cannot run http tests.\n', logs) |
| 350 | 350 |
| 351 def test_test_exists(self): | 351 def test_test_exists(self): |
| 352 port = self.make_port(with_tests=True) | 352 port = self.make_port(with_tests=True) |
| 353 self.assertTrue(port.test_exists('passes')) | 353 self.assertTrue(port.test_exists('passes')) |
| 354 self.assertTrue(port.test_exists('passes/text.html')) | 354 self.assertTrue(port.test_exists('passes/text.html')) |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 suite = VirtualTestSuite('suite/bar', 'base/foo', ['--args']) | 461 suite = VirtualTestSuite('suite/bar', 'base/foo', ['--args']) |
| 462 self.assertFalse(hasattr(suite, 'name')) | 462 self.assertFalse(hasattr(suite, 'name')) |
| 463 self.assertFalse(hasattr(suite, 'base')) | 463 self.assertFalse(hasattr(suite, 'base')) |
| 464 self.assertFalse(hasattr(suite, 'args')) | 464 self.assertFalse(hasattr(suite, 'args')) |
| 465 | 465 |
| 466 def test_legacy(self): | 466 def test_legacy(self): |
| 467 suite = VirtualTestSuite('suite/bar', 'base/foo', ['--args'], use_legacy
_naming=True) | 467 suite = VirtualTestSuite('suite/bar', 'base/foo', ['--args'], use_legacy
_naming=True) |
| 468 self.assertEqual(suite.name, 'virtual/suite/bar') | 468 self.assertEqual(suite.name, 'virtual/suite/bar') |
| 469 self.assertEqual(suite.base, 'base/foo') | 469 self.assertEqual(suite.base, 'base/foo') |
| 470 self.assertEqual(suite.args, ['--args']) | 470 self.assertEqual(suite.args, ['--args']) |
| OLD | NEW |