| Index: native_client_sdk/src/build_tools/tests/test_projects_test.py
|
| diff --git a/native_client_sdk/src/build_tools/tests/test_projects_test.py b/native_client_sdk/src/build_tools/tests/test_projects_test.py
|
| new file mode 100755
|
| index 0000000000000000000000000000000000000000..6094014413813689f4fccdff08c4ecb53facf663
|
| --- /dev/null
|
| +++ b/native_client_sdk/src/build_tools/tests/test_projects_test.py
|
| @@ -0,0 +1,31 @@
|
| +#!/usr/bin/env python
|
| +# Copyright (c) 2013 The Chromium Authors. All rights reserved.
|
| +# Use of this source code is governed by a BSD-style license that can be
|
| +# found in the LICENSE file.
|
| +
|
| +import os
|
| +import sys
|
| +import unittest
|
| +
|
| +SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__))
|
| +BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR)
|
| +CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR)))
|
| +MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock")
|
| +
|
| +sys.path.append(BUILD_TOOLS_DIR)
|
| +sys.path.append(MOCK_DIR)
|
| +
|
| +import mock
|
| +import test_projects
|
| +
|
| +class TestMain(unittest.TestCase):
|
| + """Tests for main() entry point of the script."""
|
| +
|
| + def testInvalidArgs(self):
|
| + with mock.patch('sys.stderr'):
|
| + with self.assertRaises(SystemExit):
|
| + test_projects.main(['--foo'])
|
| +
|
| +
|
| +if __name__ == '__main__':
|
| + unittest.main()
|
|
|