def test_network_cfg_test_connection_network_exception( self, mock_setdefaulttimeout, mock_connection): mock_connection.side_effect = \ connection.NetworkException("NetworkException") 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 = False self.assertEquals(expected, actual)
def test_hge_network_exception(self): utils.log.set_expected_msg(self.msg) utils.handle_gui_exception(connection.NetworkException(1337), self.msg, None) self.assertEqual(utils.log.expected_msg, self.msg)
def test_he_network_exception(self): e = connection.NetworkException(1337) try: handle_exception("huh", e) except SystemExit as e: self.assertEqual(e.code, os.EX_SOFTWARE)
def test_he_network_exception(self): e = connection.NetworkException(1337) try: managercli.handle_exception("huh", e) except SystemExit, e: self.assertEquals(e.code, -1)