summaryrefslogtreecommitdiffstats
path: root/tests/test_git_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_git_command.py')
-rw-r--r--tests/test_git_command.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/tests/test_git_command.py b/tests/test_git_command.py
index 912a9dbe..93300a6f 100644
--- a/tests/test_git_command.py
+++ b/tests/test_git_command.py
@@ -26,33 +26,6 @@ import git_command
26import wrapper 26import wrapper
27 27
28 28
29class SSHUnitTest(unittest.TestCase):
30 """Tests the ssh functions."""
31
32 def test_ssh_version(self):
33 """Check ssh_version() handling."""
34 ver = git_command._parse_ssh_version('Unknown\n')
35 self.assertEqual(ver, ())
36 ver = git_command._parse_ssh_version('OpenSSH_1.0\n')
37 self.assertEqual(ver, (1, 0))
38 ver = git_command._parse_ssh_version('OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.13, OpenSSL 1.0.1f 6 Jan 2014\n')
39 self.assertEqual(ver, (6, 6, 1))
40 ver = git_command._parse_ssh_version('OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n 7 Dec 2017\n')
41 self.assertEqual(ver, (7, 6))
42
43 def test_ssh_sock(self):
44 """Check ssh_sock() function."""
45 with mock.patch('tempfile.mkdtemp', return_value='/tmp/foo'):
46 # old ssh version uses port
47 with mock.patch('git_command.ssh_version', return_value=(6, 6)):
48 self.assertTrue(git_command.ssh_sock().endswith('%p'))
49 git_command._ssh_sock_path = None
50 # new ssh version uses hash
51 with mock.patch('git_command.ssh_version', return_value=(6, 7)):
52 self.assertTrue(git_command.ssh_sock().endswith('%C'))
53 git_command._ssh_sock_path = None
54
55
56class GitCallUnitTest(unittest.TestCase): 29class GitCallUnitTest(unittest.TestCase):
57 """Tests the _GitCall class (via git_command.git).""" 30 """Tests the _GitCall class (via git_command.git)."""
58 31