| OLD | NEW |
| 1 # Copyright (C) 2009 Google Inc. All rights reserved. | 1 # Copyright (C) 2009 Google Inc. All rights reserved. |
| 2 # Copyright (C) 2009 Apple Inc. All rights reserved. | 2 # Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. | 3 # Copyright (C) 2011 Daniel Bates (dbates@intudata.com). All rights reserved. |
| 4 # | 4 # |
| 5 # Redistribution and use in source and binary forms, with or without | 5 # Redistribution and use in source and binary forms, with or without |
| 6 # modification, are permitted provided that the following conditions are | 6 # modification, are permitted provided that the following conditions are |
| 7 # met: | 7 # met: |
| 8 # | 8 # |
| 9 # * Redistributions of source code must retain the above copyright | 9 # * Redistributions of source code must retain the above copyright |
| 10 # notice, this list of conditions and the following disclaimer. | 10 # notice, this list of conditions and the following disclaimer. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | 21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | 22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
| 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | 23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
| 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
| 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 30 | 30 |
| 31 import webkitpy.thirdparty.unittest2 as unittest | 31 import unittest |
| 32 | 32 |
| 33 from .detection import SCMDetector | 33 from .detection import SCMDetector |
| 34 from webkitpy.common.system.filesystem_mock import MockFileSystem | 34 from webkitpy.common.system.filesystem_mock import MockFileSystem |
| 35 from webkitpy.common.system.executive_mock import MockExecutive | 35 from webkitpy.common.system.executive_mock import MockExecutive |
| 36 from webkitpy.common.system.outputcapture import OutputCapture | 36 from webkitpy.common.system.outputcapture import OutputCapture |
| 37 | 37 |
| 38 | 38 |
| 39 class SCMDetectorTest(unittest.TestCase): | 39 class SCMDetectorTest(unittest.TestCase): |
| 40 def test_detect_scm_system(self): | 40 def test_detect_scm_system(self): |
| 41 filesystem = MockFileSystem() | 41 filesystem = MockFileSystem() |
| 42 executive = MockExecutive(should_log=True) | 42 executive = MockExecutive(should_log=True) |
| 43 detector = SCMDetector(filesystem, executive) | 43 detector = SCMDetector(filesystem, executive) |
| 44 | 44 |
| 45 expected_logs = """\ | 45 expected_logs = """\ |
| 46 MOCK run_command: ['svn', 'info'], cwd=/ | 46 MOCK run_command: ['svn', 'info'], cwd=/ |
| 47 MOCK run_command: ['git', 'rev-parse', '--is-inside-work-tree'], cwd=/ | 47 MOCK run_command: ['git', 'rev-parse', '--is-inside-work-tree'], cwd=/ |
| 48 """ | 48 """ |
| 49 scm = OutputCapture().assert_outputs(self, detector.detect_scm_system, [
"/"], expected_logs=expected_logs) | 49 scm = OutputCapture().assert_outputs(self, detector.detect_scm_system, [
"/"], expected_logs=expected_logs) |
| 50 self.assertIsNone(scm) | 50 self.assertIsNone(scm) |
| 51 # FIXME: This should make a synthetic tree and test SVN and Git detectio
n in that tree. | 51 # FIXME: This should make a synthetic tree and test SVN and Git detectio
n in that tree. |
| OLD | NEW |