| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # 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 |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 import unittest | 8 import unittest |
| 9 | 9 |
| 10 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 10 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 11 PARENT_DIR = os.path.dirname(SCRIPT_DIR) | 11 PARENT_DIR = os.path.dirname(SCRIPT_DIR) |
| 12 DATA_DIR = os.path.join(SCRIPT_DIR, 'data') | 12 DATA_DIR = os.path.join(SCRIPT_DIR, 'data') |
| 13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) | 13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(PARENT_DIR))) |
| 14 MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock") | 14 MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock') |
| 15 | 15 |
| 16 # For the mock library | 16 # For the mock library |
| 17 sys.path.append(MOCK_DIR) | 17 sys.path.append(MOCK_DIR) |
| 18 sys.path.append(PARENT_DIR) | 18 sys.path.append(PARENT_DIR) |
| 19 | 19 |
| 20 import sel_ldr | 20 import sel_ldr |
| 21 import mock | 21 import mock |
| 22 | 22 |
| 23 | 23 |
| 24 class TestSelLdr(unittest.TestCase): | 24 class TestSelLdr(unittest.TestCase): |
| (...skipping 25 matching lines...) Expand all Loading... |
| 50 get_platform.return_value = 'win' | 50 get_platform.return_value = 'win' |
| 51 sel_ldr.main(['foo.nexe']) | 51 sel_ldr.main(['foo.nexe']) |
| 52 parse_header.assert_called_once_with('foo.nexe') | 52 parse_header.assert_called_once_with('foo.nexe') |
| 53 self.assertEqual(call.call_count, 1) | 53 self.assertEqual(call.call_count, 1) |
| 54 cmd = call.call_args[0][0] | 54 cmd = call.call_args[0][0] |
| 55 self.assertTrue('helper_bootstrap' not in cmd[0]) | 55 self.assertTrue('helper_bootstrap' not in cmd[0]) |
| 56 | 56 |
| 57 | 57 |
| 58 if __name__ == '__main__': | 58 if __name__ == '__main__': |
| 59 unittest.main() | 59 unittest.main() |
| OLD | NEW |