コード例 #1
0
 def test_incorrect_format_target_machine_string_two_colons(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main([
             'main.py', 'user@localmachine:55:33',
             'localhost:%d' % self.metro_server_port
         ])
コード例 #2
0
    def test_successfu_connection_password_given_later(self, getpass):
        getpass.return_value = 'abc123'

        metroclient.main([
            'main.py', 'user@localhost:2222',
            'localhost:%d' % self.metro_server_port
        ])
コード例 #3
0
 def test_incorrect_format_target_machine_slash_misplaced(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main([
             'main.py', 'username@localmachine/misplaced',
             'localhost:%d' % self.metro_server_port
         ])
コード例 #4
0
 def test_no_target_machine_argument(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py', 'metroserver.com'])
コード例 #5
0
 def test_no_metro_server_argument(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py', 'testuser@localmachine'])
コード例 #6
0
 def test_no_arguments_passed(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py'])
コード例 #7
0
 def test_connection_to_not_refused_port(self):
     with self.assertRaises(SystemExit):
         metroclient.main([
             'main.py', 'user/test123@localhost:15',
             'localhost:%d' % self.metro_server_port
         ])
コード例 #8
0
 def test_connection_failure_to_ssh_tunnel(self):
     with self.assertRaises(SystemExit):
         metroclient.main([
             'main.py', 'user/[email protected]:2222',
             'localhost:%d' % self.metro_server_port
         ])
コード例 #9
0
    def test_successful_connection_password_included(self):

        metroclient.main([
            'main.py', 'user/test123@localhost:2222',
            'localhost:%d' % self.metro_server_port
        ])
コード例 #10
0
    def test_password_included_in_target_machine_string(self):

        metroclient.main([
            'main.py', 'user/test123@localhost:2222',
            'localhost:%d' % self.metro_server_port
        ])