OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2014 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 ntpath | 7 import ntpath |
8 import posixpath | 8 import posixpath |
9 import sys | 9 import sys |
10 import collections | 10 import collections |
11 import unittest | 11 import unittest |
12 | 12 |
13 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 13 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
14 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) | 14 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) |
15 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) | 15 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) |
16 MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock") | 16 MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock') |
17 | 17 |
18 # For the mock library | 18 # For the mock library |
19 sys.path.append(MOCK_DIR) | 19 sys.path.append(MOCK_DIR) |
20 from mock import call, patch, Mock | 20 from mock import call, patch, Mock |
21 | 21 |
22 sys.path.append(BUILD_TOOLS_DIR) | 22 sys.path.append(BUILD_TOOLS_DIR) |
23 import build_artifacts | 23 import build_artifacts |
24 | 24 |
25 | 25 |
26 class BasePosixTestCase(unittest.TestCase): | 26 class BasePosixTestCase(unittest.TestCase): |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 archive = build_artifacts.Archive('foo') | 300 archive = build_artifacts.Archive('foo') |
301 self.assertEqual(archive.name, 'win_foo') | 301 self.assertEqual(archive.name, 'win_foo') |
302 self.assertEqual(archive.archive_name, 'win_foo.tar.bz2') | 302 self.assertEqual(archive.archive_name, 'win_foo.tar.bz2') |
303 self.assertEqual(archive.archive_path, r'c:\archive_dir\win_foo.tar.bz2') | 303 self.assertEqual(archive.archive_path, r'c:\archive_dir\win_foo.tar.bz2') |
304 self.assertEqual(archive.dirname, r'c:\archive_dir\win_foo') | 304 self.assertEqual(archive.dirname, r'c:\archive_dir\win_foo') |
305 makedir_mock.assert_called_once_with(r'c:\archive_dir\win_foo') | 305 makedir_mock.assert_called_once_with(r'c:\archive_dir\win_foo') |
306 | 306 |
307 | 307 |
308 if __name__ == '__main__': | 308 if __name__ == '__main__': |
309 unittest.main() | 309 unittest.main() |
OLD | NEW |