Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: native_client_sdk/src/build_tools/tests/build_artifacts_test.py

Issue 720233003: [NaCl SDK] Convert python scripts from optparse to argparse. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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()
OLDNEW
« no previous file with comments | « native_client_sdk/src/build_tools/test_sdk.py ('k') | native_client_sdk/src/build_tools/tests/build_version_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698