| OLD | NEW |
| 1 # Copyright (C) 2010 Google Inc. All rights reserved. | 1 # Copyright (C) 2010 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged | 2 # Copyright (C) 2010 Gabor Rapcsanyi (rgabor@inf.u-szeged.hu), University of Sze
ged |
| 3 # | 3 # |
| 4 # Redistribution and use in source and binary forms, with or without | 4 # Redistribution and use in source and binary forms, with or without |
| 5 # modification, are permitted provided that the following conditions are | 5 # modification, are permitted provided that the following conditions are |
| 6 # met: | 6 # met: |
| 7 # | 7 # |
| 8 # * Redistributions of source code must retain the above copyright | 8 # * Redistributions of source code must retain the above copyright |
| 9 # notice, this list of conditions and the following disclaimer. | 9 # notice, this list of conditions and the following disclaimer. |
| 10 # * Redistributions in binary form must reproduce the above | 10 # * Redistributions in binary form must reproduce the above |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 class ManagerTest(unittest.TestCase): | 49 class ManagerTest(unittest.TestCase): |
| 50 | 50 |
| 51 def test_needs_servers(self): | 51 def test_needs_servers(self): |
| 52 def get_manager(): | 52 def get_manager(): |
| 53 host = MockHost() | 53 host = MockHost() |
| 54 port = host.port_factory.get('test-mac-mac10.10') | 54 port = host.port_factory.get('test-mac-mac10.10') |
| 55 manager = Manager(port, options=MockOptions(http=True, max_locked_sh
ards=1), printer=FakePrinter()) | 55 manager = Manager(port, options=MockOptions(http=True, max_locked_sh
ards=1), printer=FakePrinter()) |
| 56 return manager | 56 return manager |
| 57 | 57 |
| 58 manager = get_manager() | 58 manager = get_manager() |
| 59 self.assertFalse(manager.needs_servers(['fast/html'])) | 59 self.assertFalse(manager._needs_servers(['fast/html'])) |
| 60 | 60 |
| 61 manager = get_manager() | 61 manager = get_manager() |
| 62 self.assertTrue(manager.needs_servers(['http/tests/misc'])) | 62 self.assertTrue(manager._needs_servers(['http/tests/misc'])) |
| 63 | 63 |
| 64 def test_servers_started(self): | 64 def test_servers_started(self): |
| 65 def get_manager(port): | 65 def get_manager(port): |
| 66 manager = Manager(port, options=MockOptions(http=True, max_locked_sh
ards=1), printer=FakePrinter()) | 66 manager = Manager(port, options=MockOptions(http=True, max_locked_sh
ards=1), printer=FakePrinter()) |
| 67 return manager | 67 return manager |
| 68 | 68 |
| 69 def start_http_server(additional_dirs, number_of_drivers): | 69 def start_http_server(additional_dirs, number_of_drivers): |
| 70 self.http_started = True | 70 self.http_started = True |
| 71 | 71 |
| 72 def start_websocket_server(): | 72 def start_websocket_server(): |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 dir_name = '/tmp/layout-test-results' + '_' + str(x) | 169 dir_name = '/tmp/layout-test-results' + '_' + str(x) |
| 170 self._make_fake_test_result(port.host, dir_name) | 170 self._make_fake_test_result(port.host, dir_name) |
| 171 manager = get_manager() | 171 manager = get_manager() |
| 172 manager._limit_archived_results_count() | 172 manager._limit_archived_results_count() |
| 173 deleted_dir_count = 0 | 173 deleted_dir_count = 0 |
| 174 for x in range(1, 31): | 174 for x in range(1, 31): |
| 175 dir_name = '/tmp/layout-test-results' + '_' + str(x) | 175 dir_name = '/tmp/layout-test-results' + '_' + str(x) |
| 176 if not port.host.filesystem.exists(dir_name): | 176 if not port.host.filesystem.exists(dir_name): |
| 177 deleted_dir_count = deleted_dir_count + 1 | 177 deleted_dir_count = deleted_dir_count + 1 |
| 178 self.assertEqual(deleted_dir_count, 5) | 178 self.assertEqual(deleted_dir_count, 5) |
| OLD | NEW |