Send a crash report when a hung process is detected.
[chromium-blink-merge.git] / native_client_sdk / src / build_tools / tests / test_projects_test.py
blobca615a81d65688b249d2db7476f5589426250c5f
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.
6 import os
7 import sys
8 import unittest
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')
15 sys.path.append(BUILD_TOOLS_DIR)
16 sys.path.append(MOCK_DIR)
18 import mock
19 import test_projects
21 class TestMain(unittest.TestCase):
22 """Tests for main() entry point of the script."""
24 def testInvalidArgs(self):
25 with mock.patch('sys.stderr'):
26 with self.assertRaises(SystemExit):
27 test_projects.main(['--foo'])
30 if __name__ == '__main__':
31 unittest.main()