| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Tests for module gs_utils.""" | 6 """Tests for module gs_utils.""" |
| 7 | 7 |
| 8 import __builtin__ | 8 import __builtin__ |
| 9 import misc | |
| 10 import os | 9 import os |
| 11 import posixpath | 10 import posixpath |
| 12 import shell_utils | |
| 13 import shutil | 11 import shutil |
| 14 import sys | 12 import sys |
| 15 import tempfile | 13 import tempfile |
| 16 import time | 14 import time |
| 17 | 15 |
| 18 # Appending to PYTHONPATH to find common. | 16 # Appending to PYTHONPATH to find common. |
| 19 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'third_party', | 17 BUILDBOT_PATH = os.path.realpath(os.path.join( |
| 20 'chromium_buildbot', 'scripts')) | 18 os.path.dirname(os.path.abspath(__file__)), os.pardir, os.pardir, os.pardir) |
| 21 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'third_party', | 19 ) |
| 22 'chromium_buildbot', 'scripts', 'common')) | 20 sys.path.append(os.path.join(BUILDBOT_PATH, 'common')) |
| 23 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'third_party', | 21 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', 'chromium_buildbot', |
| 24 'chromium_buildbot', 'site_config')) | 22 'scripts')) |
| 25 sys.path.append(os.path.join(misc.BUILDBOT_PATH, 'third_party', | 23 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', 'chromium_buildbot', |
| 26 'chromium_buildbot', 'third_party', | 24 'scripts', 'common')) |
| 27 'twisted_10_2')) | 25 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', 'chromium_buildbot', |
| 26 'site_config')) |
| 27 sys.path.append(os.path.join(BUILDBOT_PATH, 'third_party', 'chromium_buildbot', |
| 28 'third_party', 'twisted_10_2')) |
| 28 | 29 |
| 29 | 30 from py.utils import shell_utils |
| 30 from slave import slave_utils | 31 from slave import slave_utils |
| 31 import gs_utils | 32 import gs_utils |
| 32 import unittest | 33 import unittest |
| 33 | 34 |
| 34 | 35 |
| 35 GSUTIL_LOCATION = slave_utils.GSUtilSetup() | 36 GSUTIL_LOCATION = slave_utils.GSUtilSetup() |
| 36 | 37 |
| 37 TEST_TIMESTAMP = '1354128965' | 38 TEST_TIMESTAMP = '1354128965' |
| 38 TEST_TIMESTAMP_2 = '1354128985' | 39 TEST_TIMESTAMP_2 = '1354128985' |
| 39 | 40 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 # pylint: disable=W0212 | 216 # pylint: disable=W0212 |
| 216 self.assertFalse( | 217 self.assertFalse( |
| 217 gs_utils._are_timestamps_equal( | 218 gs_utils._are_timestamps_equal( |
| 218 local_dir=local_dir, | 219 local_dir=local_dir, |
| 219 gs_base=self._test_gs_base, | 220 gs_base=self._test_gs_base, |
| 220 gs_relative_dir=self._test_destdir)) | 221 gs_relative_dir=self._test_destdir)) |
| 221 | 222 |
| 222 | 223 |
| 223 if __name__ == '__main__': | 224 if __name__ == '__main__': |
| 224 unittest.main() | 225 unittest.main() |
| OLD | NEW |