| OLD | NEW |
| 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 sys | 7 import sys |
| 8 import collections | 8 import collections |
| 9 import unittest | 9 import unittest |
| 10 | 10 |
| 11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) | 11 SCRIPT_DIR = os.path.dirname(os.path.abspath(__file__)) |
| 12 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) | 12 BUILD_TOOLS_DIR = os.path.dirname(SCRIPT_DIR) |
| 13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) | 13 CHROME_SRC = os.path.dirname(os.path.dirname(os.path.dirname(BUILD_TOOLS_DIR))) |
| 14 MOCK_DIR = os.path.join(CHROME_SRC, "third_party", "pymock") | 14 MOCK_DIR = os.path.join(CHROME_SRC, 'third_party', 'pymock') |
| 15 | 15 |
| 16 # For the mock library | 16 # For the mock library |
| 17 sys.path.append(MOCK_DIR) | 17 sys.path.append(MOCK_DIR) |
| 18 import mock | 18 import mock |
| 19 | 19 |
| 20 sys.path.append(BUILD_TOOLS_DIR) | 20 sys.path.append(BUILD_TOOLS_DIR) |
| 21 import build_version | 21 import build_version |
| 22 | 22 |
| 23 ProcInfo = collections.namedtuple('ProcInfo', ['returncode', 'output']) | 23 ProcInfo = collections.namedtuple('ProcInfo', ['returncode', 'output']) |
| 24 | 24 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 def testChromeCommitPositionDepthTwo(self): | 104 def testChromeCommitPositionDepthTwo(self): |
| 105 self.mockDepthTwoGitCommand() | 105 self.mockDepthTwoGitCommand() |
| 106 result = build_version.ChromeCommitPosition() | 106 result = build_version.ChromeCommitPosition() |
| 107 self.assertEqual( | 107 self.assertEqual( |
| 108 result, | 108 result, |
| 109 '6a8b61d6be4656e682eba005a1dd7f129789129c-refs/heads/master@{#292480}') | 109 '6a8b61d6be4656e682eba005a1dd7f129789129c-refs/heads/master@{#292480}') |
| 110 | 110 |
| 111 | 111 |
| 112 if __name__ == '__main__': | 112 if __name__ == '__main__': |
| 113 unittest.main() | 113 unittest.main() |
| OLD | NEW |