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

Side by Side Diff: native_client_sdk/src/build_tools/tests/test_projects_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
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8 import unittest
9
10 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
11 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
12 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
13 MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock')
14
15 sys.path.append(BUILD_TOOLS_DIR)
16 sys.path.append(MOCK_DIR)
17
18 import mock
19 import test_projects
20
21 class TestMain(unittest.TestCase):
22 """Tests for main() entry point of the script."""
23
24 def testInvalidArgs(self):
25 with mock.patch('sys.stderr'):
26 with self.assertRaises(SystemExit):
27 test_projects.main(['--foo'])
28
29
30 if __name__ == '__main__':
31 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698