Exemple #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
         ])
Exemple #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
        ])
Exemple #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
         ])
Exemple #4
0
 def test_no_target_machine_argument(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py', 'metroserver.com'])
Exemple #5
0
 def test_no_metro_server_argument(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py', 'testuser@localmachine'])
Exemple #6
0
 def test_no_arguments_passed(self, getpass):
     getpass.return_value = 'abc123'
     with self.assertRaises(SystemExit):
         metroclient.main(['main.py'])
Exemple #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
         ])
Exemple #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
         ])
Exemple #9
0
    def test_successful_connection_password_included(self):

        metroclient.main([
            'main.py', 'user/test123@localhost:2222',
            'localhost:%d' % self.metro_server_port
        ])
Exemple #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
        ])