OLD | NEW |
(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() |
OLD | NEW |