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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 os_name = 'win' | 43 os_name = 'win' |
44 os_version = 'xp' | 44 os_version = 'xp' |
45 | 45 |
46 def test_setup_environ_for_server(self): | 46 def test_setup_environ_for_server(self): |
47 port = self.make_port() | 47 port = self.make_port() |
48 port._executive = MockExecutive(should_log=True) | 48 port._executive = MockExecutive(should_log=True) |
49 output = outputcapture.OutputCapture() | 49 output = outputcapture.OutputCapture() |
50 # FIXME: This test should not use the real os.environ | 50 # FIXME: This test should not use the real os.environ |
51 orig_environ = os.environ.copy() | 51 orig_environ = os.environ.copy() |
52 env = output.assert_outputs(self, port.setup_environ_for_server) | 52 env = output.assert_outputs(self, port.setup_environ_for_server) |
53 self.assertEqual(orig_environ["PATH"], os.environ["PATH"]) | 53 self.assertEqual(orig_environ['PATH'], os.environ['PATH']) |
54 self.assertNotEqual(env["PATH"], os.environ["PATH"]) | 54 self.assertNotEqual(env['PATH'], os.environ['PATH']) |
55 | 55 |
56 def test_setup_environ_for_server_cygpath(self): | 56 def test_setup_environ_for_server_cygpath(self): |
57 port = self.make_port() | 57 port = self.make_port() |
58 env = port.setup_environ_for_server(port.driver_name()) | 58 env = port.setup_environ_for_server(port.driver_name()) |
59 self.assertEqual(env['CYGWIN_PATH'], '/mock-checkout/third_party/cygwin/
bin') | 59 self.assertEqual(env['CYGWIN_PATH'], '/mock-checkout/third_party/cygwin/
bin') |
60 | 60 |
61 def test_setup_environ_for_server_register_cygwin(self): | 61 def test_setup_environ_for_server_register_cygwin(self): |
62 port = self.make_port(options=MockOptions(register_cygwin=True, results_
directory='/')) | 62 port = self.make_port(options=MockOptions(register_cygwin=True, results_
directory='/')) |
63 port._executive = MockExecutive(should_log=True) | 63 port._executive = MockExecutive(should_log=True) |
64 expected_logs = "MOCK run_command: ['/mock-checkout/third_party/cygwin/s
etup_mount.bat'], cwd=None\n" | 64 expected_logs = "MOCK run_command: ['/mock-checkout/third_party/cygwin/s
etup_mount.bat'], cwd=None\n" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 self.assertEqual(port._build_path(), '/mock-checkout/out/Release') | 117 self.assertEqual(port._build_path(), '/mock-checkout/out/Release') |
118 # Check with 'build' being newer. | 118 # Check with 'build' being newer. |
119 port.host.filesystem.mtime = lambda f: 5 if '/build/' in f else 4 | 119 port.host.filesystem.mtime = lambda f: 5 if '/build/' in f else 4 |
120 self.assertEqual(port._build_path(), '/mock-checkout/build/Release') | 120 self.assertEqual(port._build_path(), '/mock-checkout/build/Release') |
121 | 121 |
122 def test_operating_system(self): | 122 def test_operating_system(self): |
123 self.assertEqual('win', self.make_port().operating_system()) | 123 self.assertEqual('win', self.make_port().operating_system()) |
124 | 124 |
125 def test_driver_name_option(self): | 125 def test_driver_name_option(self): |
126 self.assertTrue(self.make_port()._path_to_driver().endswith('content_she
ll.exe')) | 126 self.assertTrue(self.make_port()._path_to_driver().endswith('content_she
ll.exe')) |
127 self.assertTrue(self.make_port(options=MockOptions(driver_name='OtherDri
ver'))._path_to_driver().endswith('OtherDriver.exe')) | 127 self.assertTrue( |
| 128 self.make_port( |
| 129 options=MockOptions( |
| 130 driver_name='OtherDriver'))._path_to_driver().endswith('Othe
rDriver.exe')) |
128 | 131 |
129 def test_path_to_image_diff(self): | 132 def test_path_to_image_diff(self): |
130 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff.exe') | 133 self.assertEqual(self.make_port()._path_to_image_diff(), '/mock-checkout
/out/Release/image_diff.exe') |
OLD | NEW |