Example #1
0
    def test_network_cfg_test_connection_remote_server_exception(
            self, mock_setdefaulttimeout, mock_connection):

        mock_connection.side_effect = \
        connection.RemoteServerException("RemoteServerException")

        proxy_host = 'example.com'
        proxy_port = '10000'
        proxy_user = ''
        proxy_password = ''
        actual = self.nc.test_connection(proxy_host, proxy_port, proxy_user,
                                         proxy_password)

        expected = True
        self.assertEquals(expected, actual)
Example #2
0
 def test_hge_remote_server_exception(self):
     utils.log.set_expected_msg(self.msg)
     utils.handle_gui_exception(connection.RemoteServerException(1984),
                                self.msg, None)
     self.assertEqual(utils.log.expected_msg, self.msg)
Example #3
0
 def test_he_remote_server_exception(self):
     e = connection.RemoteServerException(1984)
     try:
         handle_exception("huh", e)
     except SystemExit as e:
         self.assertEqual(e.code, os.EX_SOFTWARE)
 def test_he_remote_server_exception(self):
     e = connection.RemoteServerException(1984)
     try:
         managercli.handle_exception("huh", e)
     except SystemExit, e:
         self.assertEquals(e.code, -1)