Ejemplo n.º 1
0
 def test_user(self, mocker):
     mocker.patch('subprocess.call')
     ssh_connect(Host(hostname='host01.example.com', user='******'), [])
     subprocess.call.assert_called_with(
         ['ssh', 'host01.example.com', '-l', 'admin'])
Ejemplo n.º 2
0
 def test_ipv4_(self, mocker):
     mocker.patch('subprocess.call')
     ssh_connect(Host(hostname='host01.example.com', ipv4='192.168.1.2'),
                 ['-4'])
     subprocess.call.assert_called_with(['ssh', '192.168.1.2', '-4'], )
Ejemplo n.º 3
0
 def test_ipv6(self, mocker):
     mocker.patch('subprocess.call')
     ssh_connect(Host(hostname='host01.example.com', ipv6='::1'), ['-6'])
     subprocess.call.assert_called_with(['ssh', '::1', '-6'])
Ejemplo n.º 4
0
 def test_port(self, mocker):
     mocker.patch('subprocess.call')
     ssh_connect(Host(hostname='host01.example.com', port='22022'), [])
     subprocess.call.assert_called_with(
         ['ssh', 'host01.example.com', '-p', '22022'], )